mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix(number-input): decimal input (#444)
* fix(number-input): decimal input * prepack * non-mobile input * pass value to input instead of inputValue
This commit is contained in:
parent
a8ef7b6f3f
commit
4b7c44994c
1 changed files with 5 additions and 3 deletions
|
@ -119,9 +119,11 @@
|
|||
dispatch("change", value);
|
||||
});
|
||||
|
||||
let inputValue = value;
|
||||
|
||||
$: incrementLabel = translateWithId("increment");
|
||||
$: decrementLabel = translateWithId("decrement");
|
||||
$: value = Number(value);
|
||||
$: value = Number(inputValue);
|
||||
$: error =
|
||||
invalid || (!allowEmpty && value === "") || value > max || value < min;
|
||||
$: errorId = `error-${id}`;
|
||||
|
@ -182,7 +184,7 @@
|
|||
aria-label="{label ? undefined : ariaLabel}"
|
||||
on:input
|
||||
on:input="{({ target }) => {
|
||||
value = target.value;
|
||||
inputValue = target.value;
|
||||
}}"
|
||||
disabled="{disabled}"
|
||||
id="{id}"
|
||||
|
@ -231,7 +233,7 @@
|
|||
aria-label="{label ? undefined : ariaLabel}"
|
||||
on:input
|
||||
on:input="{({ target }) => {
|
||||
value = target.value;
|
||||
inputValue = target.value;
|
||||
}}"
|
||||
disabled="{disabled}"
|
||||
id="{id}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue