-
Notifications
You must be signed in to change notification settings - Fork 127
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
Modal: Dropdown interactions trigger a close #813
Comments
I can’t find a discussion about it, but something we’ve been wanting to implement for a long time is a layering system. A component (or hook) would get used by every component needing one of the properties of a “layer”, which would be handling things related to the focus, the escape key, clicking outside, etc. This layer component would make sure that an escape event only gets propagated to the first one (in the React tree and not the DOM). It would also provide a way to trap the focus, which is missing at the moment. Edit: probably related to #343 |
💯 💯 totally agree, leaning on Reacts internal handling of propagation within portals would solve a lot of issues too imo. |
hey @andy-hook @bpierre - any steps to reproduce this? |
Hey @eliobricenov, any component using a popover element inside a modal will trigger this behaviour, here's a simplified repro: https://codesandbox.io/s/modal-premature-close-9mhf7?file=/src/App.js |
https://codesandbox.io/s/modal-premature-close-9mhf7?file=/src/App.js
Highly likely to be escapeOutside triggering because the dropdown popover portal is outside the modal dom tree.
The text was updated successfully, but these errors were encountered: