[TextField] - Better TextField number support
See original GitHub issueDescription
Numeric TextField
s don’t render properly if you set their value to undefined
for example, to show an empty field after a submit:
Before submit, looks good:
Afterwards when the value
is correctly set to undefined:
Images/Screenshots
Link to a gist or code sample where the issue can be reproduced
Version
- React 15.4.2
- React-MD 1.1.x
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
What is the recommended way to make a numeric TextField in ...
Very old thread, but this seems neater and strips out non-numeric characters if pasted. // force the field to be numeric only textField.textProperty()....
Read more >How to format a TextField for numbers - Hacking with Swift
You can attach a formatter to SwiftUI's TextField in order to restrict ... TextField("Enter your score", value: $score, format: .number) .
Read more >TextField | Apple Developer Documentation
Creates a text field with a text label generated from a localized title string. Available when Label is Text . ... Creates a...
Read more >[TextField] type="number" limitations #10582 - mui/material-ui
1.import text field component. 2.pass type='number' as props 3. and try to add e alphabet. text field still accepting alphabet
Read more >React Text Field component - Material UI - MUI
The TextField wrapper component is a complete form control including a label, input, and help text. It comes with three variants: outlined (default), ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, cool! I think I’ll be implementing better text field number support in an upcoming release after the feedback I’ve gotten. The native
input type="number"
is pretty terrible, so it’ll be good to update my component to fix some of those issues.The empty string approach worked. Its a bit hacky since it’s a numeric field, but definitely fine for now.