Skip to content

Commit

Permalink
fix: prevent input of too large numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
dm4t2 committed Oct 30, 2021
1 parent bb81ba0 commit 9283033
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/numberInput.ts
Expand Up @@ -148,7 +148,7 @@ export class NumberInput {
minimumFractionDigits = maximumFractionDigits = 0
}
formattedValue =
numberValue > this.toInteger(Math.abs(numberValue))
this.toInteger(Math.abs(numberValue)) > Number.MAX_SAFE_INTEGER
? this.formattedValue
: this.numberFormat.format(numberValue, {
useGrouping: this.options.useGrouping && !(this.focus && this.options.hideGroupingSeparatorOnFocus),
Expand Down

0 comments on commit 9283033

Please sign in to comment.