This repository was archived by the owner on Dec 25, 2017. It is now read-only.
This repository was archived by the owner on Dec 25, 2017. It is now read-only.
Programmatically synchronized fields failed to trigger validation #251
Open
Description
vue & vue-validator version
1.0.24, 2.1.3
Reproduction Link
See jsfiddle
Steps to reproduce
- Enter something into one input field and click somewhere else to make it blur(lose focus)
- Another input field should be synchronized
- Empty one of them and then click somewhere else to make it blur
- All two input fields should be empty but only the manually-edited one triggers the validation
Note
- Only
required
rule is used, and if the field is untouched, we think it's acceptable to be empty, hence the.invalid.touched { border: red 1px solid; }
css style. - Two input fields are synchronized programmatically, and in my project I use
vuex
so I achieve the synchronization in old-school way, instead of usingv-model
- Validation can't be grouped because in the actual project, the two fields need to be synchronized aren't on same component node.
What is Expected?
When either of two input fields goes empty and loses focus , both of them should turn into invalid, because their values are synchronized.
What is actually happening?
Only the edited input field acts as expected, another one needs an extra interaction (e.g. click on it and then click somewhere else) to trigger validation