Skip to content
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
@nandin-borjigin

Description

@nandin-borjigin

vue & vue-validator version

1.0.24, 2.1.3

Reproduction Link

See jsfiddle

Steps to reproduce

  1. Enter something into one input field and click somewhere else to make it blur(lose focus)
  2. Another input field should be synchronized
  3. Empty one of them and then click somewhere else to make it blur
  4. 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 using v-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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions