[Popover] Broken onEntering event propagation
See original GitHub issue- 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
Select options position on screen should open close to the input position
Current Behavior
Select options position on screen opens in top left window corner
Steps to Reproduce
Link: https://codesandbox.io/s/6vo1kkz64k (everything related is in src/pages/repro.js
file)
- Add Select component
- Load options of that Select component dynamically after first render (e.g. via AJAX)
- Click on that Select component
- Observe in which position on the page the Select component options open
Context
We are using dynamic options loading in our app for dynamic filtering. Without going into too much detail:
We have 2 filters. One filter is “location” filter (not related to window.location
). Second filter is “user” filter. Both filters are implemented with Select components.
The second “user” filter depends on the value of first “location” filter. If the value of first “location” filter changes, then we reload “user” filter options that depend on the selected “location” filter value.
We use that functionality in multiple places in the app.
Your Environment
Tech | Version |
---|---|
Material-UI | Tested on v3.4.0 & v.3.5.0 & v3.5.1 |
React | Tested on v16.5.2 & v16.6.3 |
Browser | Tested on Chrome 69 & 70 & MS Edge 42 |
TypeScript | |
etc. |
This started to happen when we upgraded to @material-ui/core
v.3.4.0.
Since then we’ve downgraded to v3.3.2 where this doesn’t happen.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top GitHub Comments
@DominikSerafin Thank you for taking the time to open this pull request and sharing it! The root of the issue is in the Popover: https://github.com/mui-org/material-ui/blob/7d2070fb388295d38806ecc49717006f34393e74/packages/material-ui/src/Popover/Popover.js#L321-L333
We have a
createChainedFunction()
helper function to handle this use case.The alternative is to warn so people don’t use this pattern. What do you think? Do you want to submit a pull request to handle this problem? 😃
@oliviertassinari has rewarded $72.00 to @ekoeditaa. See it on IssueHunt