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
Add maxLength type for material ui text field #18345
Conversation
types/material-ui/index.d.ts to authors (@ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv). Could you review this PR? Checklist
|
Approved by a listed owner. PR appears ready to merge pending express review by a maintainer. |
types/material-ui/index.d.ts
Outdated
@@ -1846,6 +1846,7 @@ declare namespace __MaterialUI { | |||
autoFocus?: boolean; | |||
min?: number; | |||
max?: number; | |||
maxLength?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're referring to HTML input
's maxlength, Please note that it's not maxLength
it's maxlength
. Also, please add minlength
too.
@ospfranco Please address comments from the code reviewers. |
@alitaheri this is not HTML tag property, but material UI internal property, I have not tested minLength functionality, only the maxLength as described here: mui/material-ui#1578 |
@ospfranco That's because it's not case-sensitive. Also it's not an internal prop as you can't see it used in the code other than being passed directly to Although Please rename to |
@alitaheri You are right, sorry I did not thoroughly check the source code, I've included the requested changes! thanks! |
* Add maxLength type for material ui text field * Add minlength property and change maxLength to lowercase only
Added a one more prop type for material-ui TextField component, it appears it is not well documented, but I have tested it and it is working.
Link to original issue on github mui/material-ui#1578.