ValidationProvider for nested components
See original GitHub issueHi
I have a component, named CustomInput
, which is kind of a big switch case by types, and accordingly renders the relevant field.
I want to wrap it with ValidationProvider. The problem is that the ValidationProvider works only if the rendered input is a direct child and not a nested one.
Working scenario: ValidationProvider rules=“required” -> template slot-scope -> input[type=text]
Not working: ValidationProvider rules=“required” -> template slot-scope -> CustomInputText -> input[type=text]
Any idea why it happens?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
ValidationProvider for nested components #1971 - GitHub
Hi I have a component, named CustomInput, which is kind of a big switch case by types, and accordingly renders the relevant field....
Read more >Validation Provider - VeeValidate
The ValidationProvider component is a regular component that wraps your inputs and ... meaning nested inputs inside other components will not be detected....
Read more >Observe deep nested child components with Vee-Validate v4 ...
Validation rules could be declared at the child component level. Is there a way to achieve the same in Vue3 / Vee-Validate 4?...
Read more >Vee-Validate.ValidationProvider bug with nested inputs
ValidationProvider bug with nested inputs ... Forked FromValidation Components - BootstrapVue; Environmentvue-cli. Files. src. App.vue. Input.vue. main.js.
Read more >Persisting Validation State and Nesting ValidationObservers ...
We can persist validation state with the keep-alive component. ... import { ValidationProvider, ValidationObserver, extend } from ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello,
I’ve forked and updated your code to demonstrate the issue : https://codesandbox.io/s/vue-template-xw2sl
I have just added
<template v-slot:default="slotProps">
around the input to demonstrate that Vee-Validate fails to find the input to validate.I have the same issue with VeeValidate 3.3.2.
Could you have a look please ?
I can’t help you much without a working sample, but I have a few guesses:
CustomInput
does not usev-model
which is a requirement, otherwise, you need to work with the Provider API manually.CustomInput
does not emit any events likeinput
.