🐛input type `number` allows for text input in Safari and Firefox

See original GitHub issue

Description

  • input type number allows for text input in Safari and Firefox

Expected behavior

  • When input type is number user should not be able to add text

Preview

  • typenumber-bug-safari-firefox

Extra info

Version: "react-code-input": "^3.5.0",

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
rupin-kcommented, Sep 26, 2018

@40818419 - Another issue with Input type=“number” is that for each input field there is a up-down arrow appears to increase/decrease the number.

Is there is a fix to avoid this? screen shot 2018-09-26 at 12 07 10 pm

1reaction
stefandimovbulproscommented, Sep 7, 2018

I just experienced the same issue in Chrome. Char ‘e’ is the only one I can type in. When I do that the onChange callback isn’t fired. Afterwards if I go to the next input and add a number value - onChange callback fires and the first input with the chars is cleared.

It looks like there is a small hole somewhere.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<input type="number"> - HTML: HyperText Markup Language
<input> elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries.
Read more >
Input type="number" with pattern="[0-9]*" allows letters in ...
Input type ="number" with pattern="[0-9]*" works fine in Chrome, but allows letters in FF. Is there any way to fix it without using...
Read more >
"number input type" | Can I use... Support tables for HTML5, ...
"Can I use" provides up-to-date browser support tables for support of ... Text input fields intended for email addresses, telephone numbers or URLs....
Read more >
Numeric Inputs - A Comparison of Browser Defaults
These browsers recognize type="number" and instantly serve a numeric keyboard when the input is in focus. That's pretty cool and serves as an ......
Read more >
Input type="number" with pattern="[0-9]*" allows letters in firefox
HTML : Input type =" number " with pattern="[0-9]*" allows letters in firefox [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] ...
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