fix(number-input): allowEmpty should not be invalid if value is null (#1511)

Fixes #1510
This commit is contained in:
Paweł Malinowski 2022-10-14 06:24:55 +02:00 committed by GitHub
commit 5723ffef02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,7 +131,10 @@
$: incrementLabel = translateWithId("increment");
$: decrementLabel = translateWithId("decrement");
$: error =
invalid || (!allowEmpty && value == null) || value > max || value < min;
invalid ||
(!allowEmpty && value == null) ||
value > max ||
(typeof value === "number" && value < min);
$: errorId = `error-${id}`;
$: ariaLabel =
$$props["aria-label"] ||