clear error list on enable/disable
This commit is contained in:
parent
a81bf8cd4b
commit
cc893b6eac
1 changed files with 12 additions and 2 deletions
|
|
@ -79,14 +79,19 @@ export default {
|
||||||
initialValue
|
initialValue
|
||||||
};
|
};
|
||||||
|
|
||||||
const { errorMessage, handleBlur, handleChange, meta, errors } = useField(props.inputId, props.validationRules, fieldOptions);
|
const { errorMessage,
|
||||||
|
handleBlur,
|
||||||
|
handleChange,
|
||||||
|
meta, errors,
|
||||||
|
setErrors } = useField(props.inputId, props.validationRules, fieldOptions);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
errorMessage,
|
errorMessage,
|
||||||
handleBlur,
|
handleBlur,
|
||||||
handleChange,
|
handleChange,
|
||||||
meta,
|
meta,
|
||||||
errors
|
errors,
|
||||||
|
setErrors
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -123,6 +128,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
isDisabled(newValue, oldValue) {
|
||||||
|
if (newValue !== oldValue) {
|
||||||
|
this.setErrors([]);
|
||||||
|
}
|
||||||
|
},
|
||||||
selectedOption(newValue) {
|
selectedOption(newValue) {
|
||||||
this.handleChange(newValue);
|
this.handleChange(newValue);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue