fix(number-input): value 0 should not be converted to null (#1046)

This commit is contained in:
metonym 2022-01-27 08:00:32 -08:00 committed by GitHub
commit 402de56029
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 12 deletions

View file

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