Merge pull request #432 from Safelite/feature/richardson/SSR-664.2

clear error list on enable/disable
This commit is contained in:
brich1212safe 2023-08-31 15:31:55 -04:00 committed by GitHub
commit 9fe228210a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,14 +79,19 @@ export default {
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 {
errorMessage,
handleBlur,
handleChange,
meta,
errors
errors,
setErrors
};
},
computed: {
@ -123,6 +128,11 @@ export default {
}
},
watch: {
isDisabled(newValue, oldValue) {
if (newValue !== oldValue) {
this.setErrors([]);
}
},
selectedOption(newValue) {
this.handleChange(newValue);
}