fix(number-input): fix interaction between allowEmpty and min

- accept an empty (`null`) value if `allowEmpty` is set to
  `true` and `min` is greater than zero
This commit is contained in:
Paweł Malinowski 2022-10-04 18:11:33 +02:00
commit 58c72f9841

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"] ||