Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listen to body mouseover/mouseout rather than on individual elements? #137

Closed
mattzeunert opened this issue Jul 16, 2016 · 4 comments
Closed

Comments

@mattzeunert
Copy link

mattzeunert commented Jul 16, 2016

It looks like the event listeners are added to each [data-tip] element when the ReactTooltip component mounts. That means I have to manually rebuild the bindings when the UI changes.

Would it be possible to add a mouseover listener to the body and then check if the event target element has a data-tip attribute?

@mattzeunert mattzeunert changed the title Listen to body mouseenter/mouseleave rather than on individual elements? Listen to body mouseover/mouseout rather than on individual elements? Jul 16, 2016
@wwayne
Copy link
Collaborator

wwayne commented Jul 17, 2016

It could be a solution, but not sure if it would have some other side effects, will make experiments later.

@oyeanuj
Copy link
Contributor

oyeanuj commented Dec 2, 2016

Also interested in this!

@brafdlog
Copy link

This is a significant issue.
In the current implementation if an element is rendered after the componentDidMount of the ReactTooltip component, the tooltips on it wont work.
Calling rebuild is not a solution becuase I need to know to call rebuild anywhere there might be a tooltip, and rebuild is quite heavy - calling it on every render will eventually crash the browser tab.
@wwayne what do you think?

@lanjingling0510
Copy link

Having the same issue. Dynamic elements have not come out, document.querySelectorAll not get data-tip elements, resulting in tooltip not come out.

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

No branches or pull requests

6 participants