-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
In date picker, year accepts more than 4 digits #10675
Comments
@irfanalam Are you referring to our native date-picker example in the documentation? I fear there is nothing we can do about it here. It could be an upstream limitation on the browser side. The community offers some alternative to the native date-picker. |
In native date-picker has attribute max or min, what can fix this problem, but it attributies doesn't apply to TextFiled |
Workaround: Limit dates with min-max: <TextField
InputProps={{inputProps: { min: "2020-05-01", max: "2020-05-04"} }}
type="date"
(...)
/> In my case, I only used max: 31-12-9999 |
restrictYearInput(event: KeyboardEvent) { |
Expected Behavior
When you select the date and try to change year manually it should accept only 4 digits.
Current Behavior
When you select the date and try to change year manually it accepts more than 4 digits.
Steps to Reproduce (for bugs)
Context
Your Environment
The text was updated successfully, but these errors were encountered: