mirror of
https://github.com/tenrok/maska.git
synced 2026-06-08 17:22:27 +03:00
Fix queueMicrotask working on already destroyed mask instance
This commit is contained in:
+5
-1
@@ -53,7 +53,11 @@ export class MaskInput {
|
||||
const mask = new Mask(parseInput(input, defaults))
|
||||
this.items.set(input, mask)
|
||||
|
||||
queueMicrotask(() => this.updateValue(input))
|
||||
queueMicrotask(() => {
|
||||
if (document.body.contains(input)) {
|
||||
this.updateValue(input)
|
||||
}
|
||||
})
|
||||
|
||||
if (input.selectionStart === null && mask.isEager()) {
|
||||
console.warn('Maska: input of `%s` type is not supported', input.type)
|
||||
|
||||
Reference in New Issue
Block a user