-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
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
[TextField] How to use the "pattern" attribute? #9046
Comments
My bad! The |
@verekia life saver, thanks |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
took me a while 🙈 ✅ |
Is there a way to use both |
@LavaGolem Yes, you can use both, React props are case sensitive. |
This comment has been minimized.
This comment has been minimized.
<TextField inputProps={{ className: classes.input, pattern: "[a-z]{1,15}" }} /> |
Expected Behavior
An
input
text field can have apattern
attribute containing a regex string, which the browser natively uses for validation (HTML5 spec).Current Behavior
Currently, passing
pattern
toTextField
does not transmit it to the underlyinginput
, making native regex validation impossible.Steps to Reproduce (for bugs)
https://codesandbox.io/s/wy56937zy5
Your Environment
The text was updated successfully, but these errors were encountered: