Open AgrYpn1a opened 3 weeks ago
Well, technically this is correct behaviour, since the value does not change.
@LukasTy can we provide a different "point of entry" for this? Maybe with slotProps.day.onDaySelect
?
@michelengelen Thanks for the fast response, indeed it is, but I still need a way to detect that user has clicked on that day in the calendar.
That's where @LukasTy could be of help. 👍🏼
@michelengelen as @AgrYpn1a mentioned, in v5 pickers we can detect same-day selection. We built our scheduling system based on this behavior. Same-day selection provided the toggling functionality. The toggling functionality broke when we tried to update the x-date pickers to v6 because it is no longer firing the selected day if you click on it again.
It would be great to have this function back
OK, I will add this to the board. 👍🏼
I do not think that we might want to fire an onChange
as technically the value did not change, but we are likely to find another solution for this.
Summary
I am using a StaticDatePIcker in a custom dropdown menu which needs to be closed after the day has been selected. I am using
onChange
to detect that selection, however, if I press on the same day (which is still a valid use case, because I want to confirm that I want to use the already selected day) theonChange
is not triggered.I saw that there used to be a prop called
allowSameDateSelection
that allows for that behaviour but for some reason it is removed. Is there any other way to achieve this without customising the days renderer or similar?Examples
No response
Motivation
No response
Search keywords: static date picker