ClickAwayListener triggered by descendant Select
See original GitHub issueI’m opening this issue because I saw the discussion here but the pull request closing the issue doesn’t seem to apply to my case.
I have a Select
component which is a descendant of a ClickAwayListener
component. Clicking on one of the MenuItem
s triggers the callback of ClickAwayListener
.
I saw the pull request adding disablePortal
option but I couldn’t find a way to apply it to Select (I saw it only in Popper
and Modal
components).
- This is not a v0.x issue.
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
ClickAwayListener callback shouldn’t be triggered clicking on a descendant component.
Current Behavior
But it does and I can’t find a way to apply the disablePortal
fix to Select
component. I’d like to avoid using native select to solve the issue.
Steps to Reproduce
Link:
Context
I have a Collapse
containing several filters which closes every time I select an item from the Select
filter.
Your Environment
Project generated with create-react-app, not ejected.
Tech | Version |
---|---|
Material-UI | v3.1.2 |
React | v16.5.2 |
Browser | Chrome |
TypeScript | No |
etc. |
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
@pleopardi Here is an example:
https://codesandbox.io/s/qv6z7k32nw
Duplicate of #18586