inspire-tree-dom icon indicating copy to clipboard operation
inspire-tree-dom copied to clipboard

Inline editing buttons shown for parent nodes

Open andy1547 opened this issue 6 years ago • 1 comments

When hovering over a node using inline editing the parent editing buttons are also shown. Is there anyway to opt-out of this behaviour and only show the edit buttons for the node that's being hovered over?

I imagine the focus event attached to all the elements could check a config flag (either Tree or TreeNode config), if this flag is enabled the event target could be checked to see if was emitted on that particular anchor tag or whether a child anchor emitted the event. Another option would be the flag prevents bubbling to parent anchors, but I'm less keen on this approach.

andy1547 avatar Jan 17 '19 09:01 andy1547

Right now it's done entirely via CSS, there are no events in the js. I'm not sure there's a solution that doesn't involve JS but I would prefer to toy around with that fist. Ideally I'd like to show the buttons when you hover the title (which excludes child nodes) but it would require some DOM changes which affect other things, and such a selector would likely fail as soon as the user hovers the buttons.

I could do that when a user focuses a node because the state change is unique to that li. I could also add a hovered state to the js but I prefer to avoid it if possible.

However I would prefer that be the default - showing buttons only for the current node, not its parents.

viveleroi avatar Jan 21 '19 17:01 viveleroi