-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
OutsideClick only works in the context of a single DOM tree #20
Comments
Thank for the info, if you would like to implement that, PRs are welcome. |
Actually this is solvable by adding a new prop to the component such as |
@BoostIO funded this issue with $20. Visit this issue on Issuehunt |
@sgb-io has started working. Visit this issue on Issuehunt |
@sgb-io has submitted output. Visit this issue on Issuehunt |
See #22 - working solution that solves the issue by adding a new |
Resolved by #22 |
The technique used in this library for theThe technique used in this library only works in the context of a single DOM tree. This is a problem if you want to applyOutsideClick
component is closely coupled to the DOM.<OutsideClick>
around a portal (imagine a context menu that appears next to a users mouse click, for example).If you render something inside it that contains a portal, it breaks:
A potential different, more decoupled approach, would be to make use ofonBlur
on theOutsideClick
component, tracking if the user is clicking it or something else via hover detection, but this would mean one ends up with a radically different solution.The text was updated successfully, but these errors were encountered: