From acf44ff8aee45ad88e67282604ce7849555f598e Mon Sep 17 00:00:00 2001 From: Alexander Shabunevich Date: Fri, 23 Aug 2024 12:45:41 +0300 Subject: [PATCH] fix: additional check for isTrusted event See issue #227 --- src/input.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/input.ts b/src/input.ts index 3022489..c78ebca 100644 --- a/src/input.ts +++ b/src/input.ts @@ -75,7 +75,8 @@ export class MaskInput { } private readonly onInput = (e: Event | InputEvent): void => { - if (e instanceof CustomEvent && e.type === 'input') { + // check both CustomEvent and isTrusted https://github.com/beholdr/maska/issues/227 + if (e instanceof CustomEvent && e.type === 'input' && !e.isTrusted) { return }