fix(number-input): perform null check on inputValue

This commit is contained in:
Eric Liu 2022-01-27 07:53:54 -08:00
commit 95f0b9d9e8

View file

@ -135,7 +135,7 @@
$: dispatch("change", value); $: dispatch("change", value);
$: incrementLabel = translateWithId("increment"); $: incrementLabel = translateWithId("increment");
$: decrementLabel = translateWithId("decrement"); $: decrementLabel = translateWithId("decrement");
$: value = inputValue ? Number(inputValue) : null; $: value = inputValue != null ? Number(inputValue) : null;
$: error = $: error =
invalid || (!allowEmpty && value == null) || value > max || value < min; invalid || (!allowEmpty && value == null) || value > max || value < min;
$: errorId = `error-${id}`; $: errorId = `error-${id}`;