You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 4, 2024. It is now read-only.
Observe the console, input events get continously emitted causing re-renders
What is Expected?
Adding function expression as mask should not trigger input events on every componentUpdated
What is actually happening?
I am not quite sure what exacly happens there, but I noticed that if I remove v-slot (scoped slot) from ValidationObserver then the problem disappears. Not sure why, but seems like v-mask componentUpdated triggers new input event on every component re-render which then gets listened by ValidationObserver which re-renders slotted content and v-mask again triggers input event causing a loop. Is there any specific reason why the componentUpdated method does not compare function results ? I mean this code.
var isMaskChanged = isFunction(value) || maskToString(oldValue) !== maskToString(value);
What is the purpose of marking the mask as changed if isFunction(value) ?
V-Mask and Vue versions
2.2.4, 2.6.12
Reproduction Link
https://codesandbox.io/s/v-mask-demo-forked-ch575?file=/components/Input.vue
Steps to reproduce
inputevents get continously emitted causing re-rendersWhat is Expected?
Adding function expression as mask should not trigger
inputevents on everycomponentUpdatedWhat is actually happening?
I am not quite sure what exacly happens there, but I noticed that if I remove
v-slot(scoped slot) fromValidationObserverthen the problem disappears. Not sure why, but seems like v-maskcomponentUpdatedtriggers newinputevent on every component re-render which then gets listened byValidationObserverwhich re-renders slotted content and v-mask again triggersinputevent causing a loop. Is there any specific reason why thecomponentUpdatedmethod does not compare function results ? I mean this code.What is the purpose of marking the mask as changed if
isFunction(value)?