Skip to content

Commit

Permalink
fix: don't trigger validation on initial sync
Browse files Browse the repository at this point in the history
  • Loading branch information
adamberecz committed Jun 14, 2024
1 parent 0f42649 commit 2c7f070
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -283,7 +293,7 @@ export default (options = {}, IMask = null) => ({
syncMask()
})

syncMask()
passiveSync()

// Unwatch all
watchers.value.map(w => w())
Expand Down

0 comments on commit 2c7f070

Please sign in to comment.