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
Clone the minimal test case repo, run npm install once that is complete run node test.js The assert will fail on line 35 as the model has not updated. Commenting out line 35 will allow the remaining assert to run, which will pass because the change event has been triggered.
What is expected?
When calling setValue the model should be updated to reflect that value
What is actually happening?
setValue triggers an "input" event on text input/textareas. A model with the lazy modifier does not update the model until the change event is triggered (see: https://vuejs.org/v2/guide/forms.html#lazy)
If the desire is for setValue to mimic typing perhaps then the documentation should indicate that setValue must be accompanied by a triggering of the change event if the lazy modifier is present or an optional parameter could be passed to setValue to force a change event.
The text was updated successfully, but these errors were encountered:
jaredmcateer
changed the title
setValue does not apply changes to model when lazy attribute set
setValue does not apply changes to model when lazy modifier is present
Mar 11, 2020
Good catch. I think we should support lazy. Not sure how we would detect that an element is lazy, but we might be able to get away by just calling change no matter what (shouldn't hurt?). The change would go here.
Version
1.0.0-beta.32
Reproduction link
https://github.com/jaredmcateer/vtu-set-value
Steps to reproduce
Clone the minimal test case repo, run
npm install
once that is complete runnode test.js
The assert will fail on line 35 as the model has not updated. Commenting out line 35 will allow the remaining assert to run, which will pass because the change event has been triggered.What is expected?
When calling setValue the model should be updated to reflect that value
What is actually happening?
setValue triggers an "input" event on text input/textareas. A model with the lazy modifier does not update the model until the change event is triggered (see: https://vuejs.org/v2/guide/forms.html#lazy)
If the desire is for setValue to mimic typing perhaps then the documentation should indicate that setValue must be accompanied by a triggering of the change event if the lazy modifier is present or an optional parameter could be passed to setValue to force a change event.
The text was updated successfully, but these errors were encountered: