2
0
mirror of https://github.com/tenrok/maska.git synced 2026-05-30 15:24:06 +03:00

Trigger InputEvent for support v-model update

This commit is contained in:
Alexander Shabunevich
2022-12-09 13:31:17 +03:00
parent 32bbbcf3da
commit 21a088f7d2
+3
View File
@@ -69,6 +69,8 @@ export class MaskInput {
}
private readonly inputEvent = (e: Event | InputEvent): void => {
if (e instanceof InputEvent && e.data === '__MASKA__') return
const input = e.target as HTMLInputElement
const mask = this.items.get(input) as Mask
@@ -134,5 +136,6 @@ export class MaskInput {
}
}
input.dispatchEvent(new CustomEvent<MaskaDetail>('maska', { detail }))
input.dispatchEvent(new InputEvent('input', { data: '__MASKA__' }))
}
}