Open oliviertassinari opened 5 months ago
I suspected FocusTrap
to be the issue at first, but the DateRangePicker
is using PickersPopper
as well and it does close as expected when blurring, so that cannot be the case. 🤔
@michelengelen is related on this useEffect? https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/internals/components/PickersPopper.tsx#L377-L378
This is a great issue and thanks @oukunan, that's indeed the problematic location. 👌 I have an idea of how to fix it. 😉
Looking at this I've discovered an even bigger problem with DateRangePicker.
Due to it over-utilizing event.stopPropagation
, opening it doesn't cause other Pickers to close. 🙈
Steps to reproduce
Link to live example: (required)
Steps:
https://github.com/mui/mui-x/assets/3165635/fbe1e6d2-cf08-4898-be80-f62392f2d468
Current behavior
The focus is moved back to the button that was clicked to open the popup.
Expected behavior
The focus stays on the new target
Context
I think that https://ui.shadcn.com/docs/components/date-picker behaves correctly for comparison.
Your environment
@mui/x-pickers
v7.6.1Search keywords: -