File tree 1 file changed +2
-3
lines changed
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ let width = ''
23
23
let hasFocused = false
24
24
let hasBlurred = false
25
25
26
- $: mdcTextField .value = value
27
26
$: valueLength = value? .toString ()? .length
28
27
$: hasExceededMaxLength = maxlength && valueLength > maxlength
29
28
$: hasExceededMaxValue = maxValue && internalValue > maxValue
@@ -32,7 +31,7 @@ $: showErrorIcon = hasExceededMaxValue || isLowerThanMinValue || hasExceededMaxL
32
31
$: error = showErrorIcon || (hasFocused && hasBlurred && required && ! internalValue)
33
32
$: showCounter = maxlength && valueLength / maxlength > 0.85
34
33
$: valueNotDivisibleByStep = internalValue && (internalValue / Number (step)) % 1 !== 0
35
- $: internalValue = Number (value) || ' '
34
+ $: internalValue = Number (value) || 0
36
35
37
36
onMount (() => {
38
37
mdcTextField = new MDCTextField (element)
@@ -76,7 +75,7 @@ const focus = (node) => autofocus && node.focus()
76
75
aria-labelledby ={labelID }
77
76
aria-controls =" {labelID }-helper-id"
78
77
aria-describedby =" {labelID }-helper-id"
79
- bind:value ={ internalValue }
78
+ bind:value
80
79
use:focus
81
80
on:focus ={() => (hasFocused = true )}
82
81
on:blur
You can’t perform that action at this time.
0 commit comments