We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5456777 commit 796e6a4Copy full SHA for 796e6a4
adminforth/spa/src/afcl/Input.vue
@@ -60,25 +60,17 @@ const emit = defineEmits<{
60
61
const onInput = (e: Event) => {
62
const el = e.target as HTMLInputElement;
63
- const raw = el.value;
64
65
if (props.type === 'number') {
66
- const num = Number(raw);
67
-
68
- if (isNaN(num)) {
69
- emit('update:modelValue', null);
70
- return;
71
- }
72
73
- let val = num;
+ let val = Number(el.value);
74
75
if (props.min != null && val < props.min) val = props.min;
76
if (props.max != null && val > props.max) val = props.max;
77
78
el.value = String(val);
79
emit('update:modelValue', val);
80
} else {
81
- emit('update:modelValue', raw);
+ emit('update:modelValue', el.value);
82
}
83
};
84
0 commit comments