From 928303320af0b670a731b6fd753e48904c1aac69 Mon Sep 17 00:00:00 2001 From: dm4t2 Date: Sat, 30 Oct 2021 14:27:12 +0200 Subject: [PATCH] fix: prevent input of too large numbers --- src/numberInput.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/numberInput.ts b/src/numberInput.ts index c994f4e..2d12384 100644 --- a/src/numberInput.ts +++ b/src/numberInput.ts @@ -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),