[Popper] The anchorEl
prop provided to the component is invalid
#60
Labels
bug 🐛
Something doesn't work
out of scope
The problem looks valid but we won't fix it (maybe we will revisit it in the future)
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example: https://codesandbox.io/p/sandbox/date-component-h3rd46
Video illustrating the problem: https://drive.google.com/file/d/1o4sQGAuk3N2cRw6t4o44PlE4p_hUdb23/view?usp=sharing
The example above uses a MuixTimePicker (it uses the popper component internally) to implement a date input into an AgGrid table column filter. If you click on a part of the page that is not related to either the column menu or the calendar, the calendar will jump to the upper left corner of the screen before being closed.
Current behavior 😯
Popper component (hereinafter MuiBasePopper) have useEffect witch call forceUpdate method of PopperJS instance on every time after MuiPopperBase was rendered. This behavior sometimes leads to undesirable results. In my case, the problem arises because it is not possible to correctly determine the position of the anchorEl when MuiPopperBase closing.
Expected behavior 🤔
It would be nice if forceUpdate method of PopperJS instance do not called in cases where correct updating position is not possible. Or would be some way to control this through props.
Context 🔦
When embedding MuiPopperBase and dependent components into third party libraries, we don't always have full control over the rendering process. I understand that the sudden removal of the anchorEl from the DOM is an emergency situation. But it would be nice if MuiPopperBase to handle it more gently.
The closest issue I could find.
Your environment 🌎
npx @mui/envinfo
tsconfig
The text was updated successfully, but these errors were encountered: