kazupon / vue-validator

:white_check_mark: Validator component for Vue.js
MIT License
2.19k stars 431 forks source link

Selected status of the select element is not set after selected option is removed #256

Closed xMort closed 8 years ago

xMort commented 8 years ago

Hello,

I'm not sure if this is a bug or not but I just found about this behavior in my application. Unfortunately it's legacy application that is rendered on server and all the Vue attributes are attached via jQuery in onload event. This is the reason why I cannot render whole select element by Vue repeater.

When one Vue computed variable removes active selectbox option from another select, this other select will not trigger changed event and second computed variable will not get recalculated.

I replicated the behavior in following jsFidle http://jsfiddle.net/wdgfnn0h/

When you try to switch the second select box you cannot because there is no other option. Switch the first one and second checkbox has second option. When you use it, the watcher will enable checkbox on the right. However when you switch the first select box again the option will get removed from the second select box correctly and selection is changed. Unfortunatelly the "second" model observer is not triggered and checkbox stays enabled which is incorrect. Is there some mistaken in how I use Vue or is this a bug?

xMort commented 8 years ago

Sorry, I posted the issue under wrong project :(