mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
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:
parent
c238a9a2ba
commit
58c72f9841
1 changed files with 4 additions and 1 deletions
|
@ -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"] ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue