Skip to content
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

[pickers] DateTimePicker - disablePast not working properly on mobile #8520

Closed
2 tasks done
adi-zz opened this issue Apr 5, 2023 · 2 comments · Fixed by #8570
Closed
2 tasks done

[pickers] DateTimePicker - disablePast not working properly on mobile #8520

adi-zz opened this issue Apr 5, 2023 · 2 comments · Fixed by #8570
Labels
bug 🐛 Something doesn't work component: DateTimePicker The React component. component: pickers This is the name of the generic UI component, not the React module!

Comments

@adi-zz
Copy link

adi-zz commented Apr 5, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:

Steps:

  1. Open https://mui.com/x/react-date-pickers/validation/#past-and-future-validation on mobile; alternatively you can use https://codesandbox.io/s/distracted-shirley-u93sqq?file=/demo.tsx; note the param disablePast of the component DateTimePicker
  2. Tap the DateTimePicker control
  3. Select the current day
  4. Note that in the time tab, only future hours are available - OK
  5. Select tomorrow

Current behavior 😯

In the time tab, only the hours from the above step 4 are available - NOK

Expected behavior 🤔

All hours should be available.

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Order ID or Support key 💳 (optional)

No response

@adi-zz adi-zz added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 5, 2023
@LukasTy LukasTy added bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! component: DateTimePicker The React component. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 6, 2023
@LukasTy LukasTy changed the title DateTimePicker - disablePast not working properly on mobile [pickers] DateTimePicker - disablePast not working properly on mobile Apr 6, 2023
@LukasTy
Copy link
Member

LukasTy commented Apr 6, 2023

Hello, thank you for reporting this issue. It does seem like an actual bug because the validation differs between the field and picker view behavior. The most logical fix/alignment does seem as you described—making the clock validation date aware. 👍

@LukasTy
Copy link
Member

LukasTy commented Apr 10, 2023

@adi-zz Just informing, you that in the meantime, you can use the disableIgnoringDatePartForTimeValidation prop if that does not impact your use case, to make the visual validation correct. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: DateTimePicker The React component. component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants