question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[TextField] - Better TextField number support

See original GitHub issue

Description

Numeric TextFields 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: image

Afterwards when the value is correctly set to undefined: image

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:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mlaursencommented, Mar 7, 2017

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.

0reactions
maxcancommented, Mar 7, 2017

The empty string approach worked. Its a bit hacky since it’s a numeric field, but definitely fine for now.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found