You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
form is submitting and ignoring MobileDatePicker& MobileTimePicker which are required and have no value, required seems to be set successfully on the html
Expected behavior
form shouldn't submit if there's no value for the MobileDatePicker or MobileTimePicker
mazenadel19
changed the title
Validation not working for MobileDatePicker component
Validation not working for MobileDatePicker& MobileTimePicker components
Mar 19, 2024
This is a side-effect of Mobile Pickers having the readonly prop.
We have a separate issue (#7869) for removing this prop.
@mui/explore WDYT, would it make sense to put the mentioned issue back to grooming and properly discuss, groom, and prioritize? Having it in "to explore" "Neverland" does not sound promising. 🙈
In the meantime, if you are fine with a not-ideal solution, consider overriding the readonly prop with:
I gave the solution a try, and it worked like a charm!
Thanks a bunch for your help, I'll go ahead and close this since I see you're already keeping an eye on the same issue elsewhere.
⚠️This issue has been closed.
If you have a similar problem, please open a new issue and provide details about your specific problem.
If you can provide additional information related to this topic that could help future readers, please feel free to leave a comment.
How did we do @mazenadel19?
Your experience with our support team matters to us. If you have a moment, please share your thoughts through our brief survey.
Steps to reproduce
Link to live example: https://codesandbox.io/p/sandbox/sweet-moon-d4xl8x?file=%2Fsrc%2FDemo.js%3A45%2C10-45%2C26
Current behavior
form is submitting and ignoring MobileDatePicker& MobileTimePicker which are required and have no value, required seems to be set successfully on the html
Expected behavior
form shouldn't submit if there's no value for the MobileDatePicker or MobileTimePicker
Context
No response
Your environment
npx @mui/envinfo
Search keywords: MobileDatePicker, Validation
The text was updated successfully, but these errors were encountered: