Type text input events

This commit is contained in:
lucast committed 2026-10-06 02:46:25 +02:00
1 parent 379acf400c
commit d76ecf6063
1 file changed
+6 -2
+6 -2
View File
@@ -41,6 +41,10 @@ const onFileChange = (e: Event) => {
value.value = result
emit("file", result)
}
const onTextInput = (e: Event) => {
emit("input", (e.currentTarget as HTMLInputElement | HTMLTextAreaElement).value)
}
</script>
<template>
@@ -68,7 +72,7 @@ const onFileChange = (e: Event) => {
v-if="props.type != 'file' && props.type != 'textarea'"
:placeholder="props.placeholder"
v-model="value"
@input="(e) => emit('input', e.target?.value)"
@input="onTextInput"
@focus="emit('focus')"
@blur="emit('blur')"
:type="props.type"
@@ -82,7 +86,7 @@ const onFileChange = (e: Event) => {
v-else-if="props.textarea"
:placeholder="props.placeholder"
v-model="value"
@input="(e) => emit('input', e.target?.value)"
@input="onTextInput"
@focus="emit('focus')"
@blur="emit('blur')"
:name="props.name"