Max length for InputNumber (equal to allowed digits) (#4034)
* Max length for InputNumber (equal to allowed digits) * Description on length check
This commit is contained in:
parent
e7fbe3bc38
commit
685971fa09
@ -243,7 +243,10 @@ function InputNumber ({ autoFocus, bitLength = DEFAULT_BITLENGTH, children, clas
|
||||
[_onChangeWithSi, value]
|
||||
);
|
||||
|
||||
const maxValueLength = getGlobalMaxValue(bitLength).toString().length - 1;
|
||||
// Same as the number of digits, which means it can still overflow, i.e.
|
||||
// for u8 we allow 3, which could be 999 (however 2 digits will limit to only 99,
|
||||
// so this is more-or-less the lesser of evils without a max-value check)
|
||||
const maxValueLength = getGlobalMaxValue(bitLength).toString().length;
|
||||
|
||||
return (
|
||||
<Input
|
||||
|
||||
Loading…
Reference in New Issue
Block a user