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.

input type="number" does not work properly

See original GitHub issue

Hi @changhuixu

First of all thanks for the good work. The lib is pretty good and has a lot of edge case validations.

But why are all the samples using input type="text" which technically sounds wrong because we are expecting a number input.

Our input controls needs a spinner which can be controlled by arrow keys on the keyboard. But when we add digitOnly to the input type="number" there are two problems arise

  • Arrow keys to control to increase / decrease the values does not work
  • Also when i try to manually enter the max value it does not allow me to enter.

Please find the reproducible link here for this bug 🐛 - CodeSandbox

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
changhuixucommented, Jan 22, 2021

Thank you @sashatrn I will update the readme.

1reaction
changhuixucommented, Jan 13, 2021

Hi @gethari , you are right. The input type="number" won’t work. This library is intended to be used in text input.

Read more comments on GitHub >

github_iconTop Results From Across the Web

input type number in html 5 is not working? - Stack Overflow
This is how you use the input type number in HTML5: <input type="number" name="cost">. Here is a working example of the input type...
Read more >
<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 >
Why the number input is the worst input - Stack Overflow Blog
If you are building a form that requires conditional validations or calculations, it is hard to understate just how big of a problem...
Read more >
You probably don't need input type=“number” - CSS-Tricks
Brad Frost wrote about a recent experience with a website that used <input type="number"> :
Read more >
input[type='number'] value isn't updated · Issue #13651 - GitHub
Assuming I'm thinking about this correctly, it looks like the issue is that the value attribute is reporting as "01" when it should...
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