EZQMS-403: Displatch value update from EditBox (#4114)

* EZQMS-403: Displatch value update from EditBox

Signed-off-by: Anna No <anna.no@xored.com>

* EZQMS-403: Displatch value update from EditBox

Signed-off-by: Anna No <anna.no@xored.com>

---------

Signed-off-by: Anna No <anna.no@xored.com>
This commit is contained in:
Anna No 2023-11-30 20:07:21 +07:00 committed by GitHub
parent 610e9e5e0c
commit 32e39a3723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,16 @@
} else {
target.style.width = Math.max(text.clientWidth, 50) + 'px'
}
}
function handleInput (ev: Event): void {
const t: HTMLInputElement | EventTarget | null = ev.target
if (t !== null && t !== undefined) {
computeSize(t)
}
dispatch('input')
dispatch('value', value)
}
onMount(() => {
@ -168,9 +177,7 @@
bind:value
placeholder={phTraslate}
{style}
on:input={(ev) => {
computeSize(ev.target)
}}
on:input={handleInput}
on:change
on:keydown
on:keypress
@ -185,9 +192,7 @@
bind:value
placeholder={phTraslate}
{style}
on:input={(ev) => {
computeSize(ev.target)
}}
on:input={handleInput}
on:change
on:keydown
on:keypress
@ -201,9 +206,7 @@
bind:value
placeholder={phTraslate}
{style}
on:input={(ev) => {
computeSize(ev.target)
}}
on:input={handleInput}
on:change
on:keydown
on:keypress