Skip to content

Commit 2c7f070

Browse files
committed
fix: don't trigger validation on initial sync
1 parent 0f42649 commit 2c7f070

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/plugin.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,16 @@ export default (options = {}, IMask = null) => ({
272272
value.value = unmask.value ? Mask.value.masked.unmaskedValue : Mask.value.value
273273
}
274274

275+
const passiveSync = () => {
276+
el$.value.resetting = true
277+
278+
syncMask()
279+
280+
nextTick(() => {
281+
el$.value.resetting = false
282+
})
283+
}
284+
275285
const initMask = () => {
276286
if (Mask.value) {
277287
destroyMask()
@@ -283,7 +293,7 @@ export default (options = {}, IMask = null) => ({
283293
syncMask()
284294
})
285295

286-
syncMask()
296+
passiveSync()
287297

288298
// Unwatch all
289299
watchers.value.map(w => w())

0 commit comments

Comments
 (0)