When I open a mui date picker then scroll so it's at all off screen/hidden and then close it by clicking outside of it the screen jumps so the initial input is in view. I would like the screen not to jump/scroll at all when the picker closes.
For an example, open the first datepicker (titled "date desktop") in mui's example page, scroll down the page so the datepicker disappears, then click away from the datepicker.
Mui's page: https://mui.com/x/react-date-pickers/getting-started/
I think this has something to do with the popper trying to focus the datepicker and bring it back on screen when it closes but I'm not sure what to target to disable this behavior'.
I tried the above and expected the datepicker to close and the screen to stay in place, but instead it jumped.
You could also see the behaviour in this code sandbox: https://codesandbox.io/s/focused-architecture-fg5yvl
Open the datepicker, scroll down so it's off screen, then click. You'll be jumped up to the datepicker; Is there a way to avoid this behaviour?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/W2IE7d1
Comments
Post a Comment