-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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] Accept number as defaultValue #2423
Comments
@doaboa Unfortunately Try to tackle it a bit and if it proves to be hard, I'll provide an example for you. |
Thank you @subjectix! This is actually fine for me functionally, I'm still able to set a min & max value (when using defaultValue instead of value), disable non-numeric characters, handle errors through snackbar and get number input arrows/selection on chrome, firefox, safari and ios. I'm wondering if there is something else unsupported that I'm not thinking of, hence the warning? Lookin forward to #2416 |
I can't say for sure, but I think one tricky thing about using At some point we might want to consider an input validator or something that can prevent input of characters based on a regex expression or something. That way we can ensure inputs look consist across value types. There are some other gotchas I'm sure but later we can investigate better approaches to handling this. |
Trying to use textfield as a number input, like so:
Where allowance.defaultQty is a number. It works, but I get this warning:
Should TextField accept proptype number as a defaultValue, or is there a better alternative?
Thanks!
The text was updated successfully, but these errors were encountered: