You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The validation not working correct when using model less validation with a default value.
This is especially a problem when using render functions that doesn't support v-model.
Additional context
Some investigation brought me to the findModel method .
This function returns undefined and that causes that the extractVNodes function returns an empty array.
That will cause that the addListeners will not be called and the onRenderUpdate method can not set the (initial) value
Possible fix on the findModel method:
export functionfindModel(vnode: VNode): VNodeDirective|undefined{if(!vnode.data){returnundefined;}// Component Model// THIS IS NOT TYPED IN OFFICIAL VUE TYPINGS// eslint-disable-next-lineconstnonStandardVNodeData=vnode.dataasany;if('model'innonStandardVNodeData){returnnonStandardVNodeData.model;}++if(vnode.data.props&&'value'invnode.data.props){++return{value: vnode.data.props.value}++}++if(!vnode.data.directives){
return undefined;}returnfind(vnode.data.directives,d=>d.name==='model');}
The text was updated successfully, but these errors were encountered:
Ricky-rick
changed the title
Validation not working when using manual validation with a default value.
Validation not working when using model less validation with a default value.
Sep 20, 2019
Versions
The validation not working correct when using model less validation with a default value.
This is especially a problem when using render functions that doesn't support v-model.
To reproduce
Steps to reproduce the behavior:
Expected behavior
No validation error because we have an initial value
Demo link
https://codesandbox.io/s/veevalidate-30-async-rule-example-i6x7x
Additional context
Some investigation brought me to the findModel method .
This function returns undefined and that causes that the extractVNodes function returns an empty array.
That will cause that the addListeners will not be called and the onRenderUpdate method can not set the (initial) value
Possible fix on the findModel method:
The text was updated successfully, but these errors were encountered: