@stubber/form-fields 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -41,13 +41,9 @@ import FieldLabel from "../FieldLabel.svelte";
|
|
|
41
41
|
import FieldMessage from "../FieldMessage.svelte";
|
|
42
42
|
export let fieldStore;
|
|
43
43
|
function onInput(e) {
|
|
44
|
-
const
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
$fieldStore.value = parsedValue;
|
|
48
|
-
} else {
|
|
49
|
-
$fieldStore.value = new_value;
|
|
50
|
-
}
|
|
44
|
+
const input_element = e.target;
|
|
45
|
+
let { value } = input_element;
|
|
46
|
+
$fieldStore.value = value;
|
|
51
47
|
}
|
|
52
48
|
function onBlur() {
|
|
53
49
|
let parsedValue = parseFloat($fieldStore.value);
|
|
@@ -73,5 +69,9 @@ function onBlur() {
|
|
|
73
69
|
on:input={onInput}
|
|
74
70
|
on:blur={onBlur}
|
|
75
71
|
aria-invalid={$fieldStore.validation_result?.type == "error" ? true : undefined}
|
|
72
|
+
type="number"
|
|
73
|
+
step={$fieldStore.step || 0}
|
|
74
|
+
max={$fieldStore.max}
|
|
75
|
+
min={$fieldStore.min}
|
|
76
76
|
/>
|
|
77
77
|
<FieldMessage {fieldStore} />
|