mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
fix(number-input): allowEmpty
should not be invalid if value is null
(#1511)
Fixes #1510
This commit is contained in:
parent
b5b392963e
commit
5723ffef02
1 changed files with 4 additions and 1 deletions
|
@ -131,7 +131,10 @@
|
||||||
$: incrementLabel = translateWithId("increment");
|
$: incrementLabel = translateWithId("increment");
|
||||||
$: decrementLabel = translateWithId("decrement");
|
$: decrementLabel = translateWithId("decrement");
|
||||||
$: error =
|
$: error =
|
||||||
invalid || (!allowEmpty && value == null) || value > max || value < min;
|
invalid ||
|
||||||
|
(!allowEmpty && value == null) ||
|
||||||
|
value > max ||
|
||||||
|
(typeof value === "number" && value < min);
|
||||||
$: errorId = `error-${id}`;
|
$: errorId = `error-${id}`;
|
||||||
$: ariaLabel =
|
$: ariaLabel =
|
||||||
$$props["aria-label"] ||
|
$$props["aria-label"] ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue