Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Fix events for labels of groups with nestedGroups #154

Merged
merged 2 commits into from
Apr 26, 2019

Conversation

sbusch
Copy link
Contributor

@sbusch sbusch commented Apr 9, 2019

E.g. links can now be clicked in groups containing other groups, aswell.

Closes #140

Problem was the re-rendering of group labels for expanding/collapsing groups, which causes the originating event targets (e.g. links) to be removed from the DOM. The event now won't bubble up because there's no parent anymore (to my understanding). The timeout of 1 ms breaks the expand/collapse out of the event processing, which lets the browser finish the event processing before the DOM is being modified. Expand/collapse is performed after that, as soon as the browser is idle again.

Note: group still exands/collapses when clicked on the link, and this is quite noticeable for the user. But I found no way to prevent this behavior.

expanding and collapsing causes the group labels to re-render. event target doesnt exist as a consequence, and event will be canceled immediately.
with this patch, group labels can contain interactive elements like links (a tags)
@sbusch
Copy link
Contributor Author

sbusch commented Apr 9, 2019

Possibly better explanation: click event is not triggered because the node is removed from DOM during mouse down

@yotamberk yotamberk merged commit a04a05f into yotamberk:develop Apr 26, 2019
@yotamberk
Copy link
Owner

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants