mirror of
https://github.com/tenrok/maska.git
synced 2026-05-15 11:59:38 +03:00
Merge pull request #260 from le0pard/fix_microtask
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