mirror of
https://github.com/tenrok/maska.git
synced 2026-06-23 20:40:35 +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))
|
const mask = new Mask(parseInput(input, defaults))
|
||||||
this.items.set(input, mask)
|
this.items.set(input, mask)
|
||||||
|
|
||||||
queueMicrotask(() => this.updateValue(input))
|
queueMicrotask(() => {
|
||||||
|
if (document.body.contains(input)) {
|
||||||
|
this.updateValue(input)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
if (input.selectionStart === null && mask.isEager()) {
|
if (input.selectionStart === null && mask.isEager()) {
|
||||||
console.warn('Maska: input of `%s` type is not supported', input.type)
|
console.warn('Maska: input of `%s` type is not supported', input.type)
|
||||||
|
|||||||
Reference in New Issue
Block a user