-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Date selection does not work inside MUI Modal #184
Comments
hey, @wojtekmaj I'd really appreciate a fix to this. If the datepicker is in a modal in the Safari Browser on MacOSX, and you click the input to open the datepicker dropdown, the calendar days and month don't update when clicking the right and left arrows. |
@wojtekmaj This is what happens when I open the datepicker and click the right arrow twice: (again, it only happens in MacOS Safari in a modal) |
What do you mean "in a modal"? Do you have time to create reproducible example on CodeSandbox? |
I've updated the example to use v4.0.0 from yesterday - instructions are still valid from above (section "Steps to reproduce it"). It's still 100% reproducible. https://codesandbox.io/s/react-datetime-picker-61wq02?file=/index.js |
It looks like MUI is messing the styles up. Safari has nothing to do with it, on Chrome it's the same story. Here it is compared to native https://codesandbox.io/s/react-datetime-picker-mui-and-native-dialogs-r6vnf9 I don't know anything about MUI specifics, and I don't know how they manipulate Dialog's children, so I won't be able to help you with it personally, but I'll keep it open if anyone from the community would be willing to help. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days. |
This issue was closed because it has been stalled for 14 days with no activity. |
TLDR: This is a clone of wojtekmaj/react-date-picker#288 for the
datetime-picker
. The suggested fix solution worked on the 3.5.0 release ofdatetime-picker
.The bug
The issues is that the calendar popup closes, but does not propagate the selected date, when clicking on a date when it is itself is within a Modal on Safari. It is very specific to the last two conditions, but well, that's exactly our scenario :)
Steps to reproduce it
To reproduce:
2022/5/5
in the screenshot)10
) and with clickExpected:
2022/5/10
)Actual:
2022/5/5
)Screenshot
A Validated solution
For the 3.5.0 release was the below patch (from the wojtekmaj/react-date-picker#288) :
3.5.0 vs latest main
I'm not sure whether the issue reproduces on current
main
(2dce2af) as theonOutsideAction
part changed slightly.The text was updated successfully, but these errors were encountered: