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.

Allow users to enter out-of-bound numbers, outside of the `minimumValue` and `maximumValue` range

See original GitHub issue

Currently, if a user sets the minimumValue option to a value superior to zero, it effectively prevent him to delete the input value, since it would mean the rawValue would be equal to 0.

While this is exactly what the minimumValue option is for, I see a use case where users would want to be able to temporarily clear the element, in order to type their valid values.

Allowing this will bring some side effects:

  • First, the rawValue will be updated with a potential incorrect out of range value while the user is typing it (the user would then need to manage those error cases),
  • Second, we would need to allow not only the value 0, but any values between 0 and the minimumValue
    • For instance this means that if we have a minimumValue set to 1234, then we would need to allow the user to type 1, 12 and 123 before finally accepting the correct value 1234.

To that end, we would need to create a new option overrideMinimumValueLimitation (or something equivalent) set to false by default, that would allow a user to input values between 0 and minimumValue in the element, and would then revert to the last good known value on blur if it’s still equal out of range.

This seems not trivial.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:23 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
kaikun213commented, Jul 14, 2020

Great, I think the documentation is still missing the new option http://autonumeric.org/configurator @AlexandreBonneau

1reaction
AlexandreBonneaucommented, Apr 26, 2020

It took 2 years, but it’s finally here 😉

The latest AutoNumeric version 4.6.0 integrates the new 'invalid' option for the overrideMinMaxLimits setting. Using that will allow you to solve your problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Restrict input type="number" to its min or max if it is out of range
Actually input type=number only handles and not allows user to submit the form if the entered number is not in range.
Read more >
Easy Number and Currency Formatting Library - autoNumeric
Allow users to enter out-of-bound numbers, outside of the `minimumValue` and `maximumValue` range. v4.5.13 (2020-02-16). Bugs fixed.
Read more >
CWE-839: Numeric Range Comparison Without Minimum Check
However, this method only verifies that the given array index is less than the maximum length of the array but does not check...
Read more >
https://www.cfa.harvard.edu/atmosphere/Instruments...
Metadata Name: GranuleDay Mandatory: T Data Type: HE5T_NATIVE_INT Number of Values: 1 Minimum Value: 1 Maximum Value: 31 Data Source: PGE Description: The ......
Read more >
Input Output Reference - EnergyPlus
1.1 What's different about EnergyPlus Input and Output? ... 1.10.45 Surface Output Variables (exterior heat transfer surfaces) .
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