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.

HTML input elements with type number should only be valid when a number is passed.

See original GitHub issue

Currently the checkValidity() method on an input element of type number only checks the lower and the upper bound of the value that is passed. When something is passed that isn’t a number at all checkValidity() returns true although it should return false.

I’ll open a pull request that demonstrates the problem and suggests a fix in a minute.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:25 (25 by maintainers)

github_iconTop GitHub Comments

1reaction
rbicommented, Mar 3, 2021

I think it should be the right Snapshot:

0reactions
rbricommented, Apr 23, 2021

Mis… - was moved to spam.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<input type="number"> - HTML: HyperText Markup Language
A number input is considered valid when empty and when a single number is entered, but is otherwise invalid. If the required attribute...
Read more >
Number input type that takes only integers? - Stack Overflow
It's been working great so far except for one thing. In the HTML5 specification, the input type "number" can have both integers and...
Read more >
Why the number input is the worst input - Stack Overflow Blog
When the number input contains an invalid value and you retrieve the value, you get a blank string. Valid numbers include more than...
Read more >
Making HTML 5 Numeric Inputs Only Accept Integers - Medium
The Fix? Use the pattern and step attributes so as to restrict what's valid. Issue #2, Bad Or incomplete Regex Patterns.
Read more >
lightning-input - documentation - Salesforce Developers
To specify valid increments for numerical fields, use the step attribute. The value of step constrains the numbers that users can enter. If...
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