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.

Automatically sign input value based on valueRange

See original GitHub issue

Hi,

I’m currently in a situation where multiple v-currency-fields should only allow negative values. I can use the valueRange option for that, which is a nice technical solution for “implicit validation”.

But from an end-user point of view, it would be nice if the value has its sign automatically “added”, based on the valueRange option (eg: multiply Math.abs(value) by -1 when max < 0 and min >= Number.MIN_SAFE_INTEGER).

Of course, to allow for switching this feature on and off, there may be a need for an extra autoSign option?

Or would there be another approach to this?

Thanks, Glenn

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
dm4t2commented, Feb 12, 2021

Hi, thanks for your suggestion. I think it’s a nice idea which is also capable to replace the existing allowNegative option for forcing positive values. I will have a look at it 👍

0reactions
glenncoppenscommented, Feb 18, 2021

@dm4t2

Nice one!

Read more comments on GitHub >

github_iconTop Results From Across the Web

<input type="range"> - HTML: HyperText Markup Language
elements of type range let the user specify a numeric value which must be no less than a given value, and no more...
Read more >
HTML5 input type range show range value - Stack Overflow
I am making a website where I want to use range slider(I know it only supports webkit browsers). I have integrated it fully...
Read more >
Value Bubbles for Range Inputs | CSS-Tricks
Here we're making sure we account for the range inputs min and max attributes and calculating a % position between 0-100 based on...
Read more >
[MS-OGRAPH]: ValueRange | Microsoft Learn
This record specifies the properties of a value axis. ... A - fAutoMin (1 bit): A bit that specifies whether numMin is calculated...
Read more >
How to assign a value or category based on a number range ...
1. Select a blank cell, enter the following formula and press the Enter key. Select the result cell, drag its AutoFill Handle down...
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