Open joserodolfofreitas opened 1 year ago
So this connects to points 2 and 3 in #8964.
Personally, I would remove this auto-close behavior anywhere there is more than one widget. So only keep it for the date picker. It feels borderline there, but since end-users click on the day with a given year and month in context, it's probably OK.
Is there any way to disable the auto closing behavior on click of AM/PM for now?
Is there any way to disable the auto closing behavior on click of AM/PM for now?
Have you tried specifying closeOnSelect={false}
? 🤔
https://mui.com/x/api/date-pickers/time-picker/#TimePicker-prop-closeOnSelect
That helped! Thanks a lot!
@joserodolfofreitas I gave this one a bit more though and I'm not sure if we should be creating any additional view behavior "magic" as opposed to just going with a simple approach suggested by Olivier: https://github.com/mui/mui-x/issues/9310#issuecomment-1687115621 and also done by most other Time Pickers:
That makes sense, @LukasTy. Let's simplify the flow and remove the "magic" behavior.
I discussed this with @LukasTy, and it was agreed that this issue would be better addressed in the next major release, since the solution involves changing the default value of the closeOnSelect
prop, as well as modifying the default behavior of some components. Although it might be safe to include this in a minor version, since we're nearing the next major release, we can ensure even greater safety by postponing it and avoiding any unexpected regressions in the final days of v7.
The PR linked to the issue remains open for additional changes and reviews.
@joserodolfofreitas let us know if you have any more inputs ! 🙂
Summary
The auto-closing strategy on the Digital Clock is an interesting piece of usability.
Currently, the time picker component closes as soon as the meridian (AM/PM) is selected, regardless of whether the rest of the time has been chosen or not. This can lead to confusion for users who might still be in the process of setting the hour or minute.
I believe a more intuitive behavior would be for the time picker to remain open until the user has had a chance to select all parts/sections of the time (hour, minute, (seconds) and meridian). This would ensure that users have fully specified their intended time before the picker closes.
Here's an example of the current behavior:
And here's the proposed behavior:
I believe the proposed strategy also works fine with having an extra OK button to early closes the time picker, in case the user doesn't wish to select all sections of a time.