Closed
Description
In the last major release, we removed the css overlay approach to handling showing/hiding the SelectMenu to support places where a SelectMenu might be nested inside of an absolutely positioned element.
The JS approach checks if the click happens outside of the details
element that wraps the SelectMenu to determine whether or not to close the menu.
In another application that uses Primer React Components, React Portals are used to open menus in places other than where they are triggered. Because of this, the menu content no longer has a details
parent, and clicking on items inside of the menu (such as the filter input) closes the menu when it should not.
- Should we support using menus inside of Portals? Is this an accessibility concern that we should intentionally not support?
- Would it make sense to add an
onOutsideClick
callback toSelectMenu
so that users can opt out of the default SelectMenu outside click handling? Will this mess up the internal state?
Follow up items
- Research accessibility of using menus inside of React Portals
- Test out a custom
onOutsideClick
approach
cc @lerebear
Metadata
Metadata
Assignees
Labels
No labels