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:
water_lift 2020-12-09 11:08:28 -06:00 committed by GitHub
commit 4b7c44994c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}"