base-ui
base-ui copied to clipboard
[popover] Fix nested `openOnHover`
Fixes #1932
Possible questions:
- Should the nested popover disable the
useHoverof the parent hovered popover likeMenudoes? This means it requires an outside press to dismiss rather than a hover out. FloatingTreecan't generalize between different floating components (e.g. PopoveropenOnHover-> MenuopenOnHoverwill close the Popover unexpectedly). It is possible that dot point 1 would solve this if we detected it landed in adata-floating-ui-portal(but maybe not all cases where we land in a new popup should prevent closing the parent).
Deploy Preview for base-ui ready!
| Name | Link |
|---|---|
| Latest commit | a5bb1e49aca4664fd2a828458dd5186c190ba45e |
| Latest deploy log | https://app.netlify.com/projects/base-ui/deploys/6835b0ba2c375b0008112a63 |
| Deploy Preview | https://deploy-preview-1938--base-ui.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
FloatingTree can't generalize between different floating components (e.g. Popover openOnHover -> Menu openOnHover will close the Popover unexpectedly). It is possible that dot point 1 would solve this if we detected it landed in a data-floating-ui-portal (but maybe not all cases where we land in a new popup should prevent closing the parent).
We can introduce a "container" context across the library, similarly to how menu parent context works. Components that can have other components nested (like dialogs, toolbars, popovers, etc.) could set up a context the will make children aware if they are placed inside. Such context could expose methods such as close so that children can control parent's behavior to a degree.