Vee-validate: Validation on blur fails with custom components

Created on 18 Oct 2018  ยท  2Comments  ยท  Source: logaretm/vee-validate

Versions

  • vee-validate: 2.1.0-beta.11
  • vue: 2.5.17

Describe the bug
Validation on custom components work only with default configuration (on input event). After updating it to blur event it is no longer executing any checks at all.

To Reproduce
I've just added { events: 'blur' } to VeeValidate config that broke Custom Component Example from the docs.

Expected behavior
The custom component should trigger validation on blur.

Demo Link
Forked examples from the docs are here: https://codesandbox.io/s/rl469y6qmq
Please see Custom Component Example.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: 69
โ” question

Most helpful comment

Does the custom component emit a blur event? as long as the component emits the appropiate events, vee-validate can use them as a validation trigger. So you should always consult the docs for said components to be able to tell which events are emitted from them.

here is the same example but updated the TextInput component to emit the __blur__ event.

https://codesandbox.io/s/o71plx441z

All 2 comments

Does the custom component emit a blur event? as long as the component emits the appropiate events, vee-validate can use them as a validation trigger. So you should always consult the docs for said components to be able to tell which events are emitted from them.

here is the same example but updated the TextInput component to emit the __blur__ event.

https://codesandbox.io/s/o71plx441z

This makes perfect sense, thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schel4ok picture schel4ok  ยท  3Comments

DanielPe05 picture DanielPe05  ยท  3Comments

yyyuuu777 picture yyyuuu777  ยท  3Comments

Shchepotin picture Shchepotin  ยท  3Comments

Etheryte picture Etheryte  ยท  3Comments