From 2c7f070e765915934287156b77869953d603920e Mon Sep 17 00:00:00 2001 From: Adam Berecz Date: Fri, 14 Jun 2024 14:18:26 +0200 Subject: [PATCH] fix: don't trigger validation on initial sync --- src/plugin.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugin.js b/src/plugin.js index e3a4b6e..727a8ce 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -272,6 +272,16 @@ export default (options = {}, IMask = null) => ({ value.value = unmask.value ? Mask.value.masked.unmaskedValue : Mask.value.value } + const passiveSync = () => { + el$.value.resetting = true + + syncMask() + + nextTick(() => { + el$.value.resetting = false + }) + } + const initMask = () => { if (Mask.value) { destroyMask() @@ -283,7 +293,7 @@ export default (options = {}, IMask = null) => ({ syncMask() }) - syncMask() + passiveSync() // Unwatch all watchers.value.map(w => w())