From cc893b6eacc8d217e295b83ca0e4d4da3fafcb73 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 31 Aug 2023 13:16:44 -0400 Subject: [PATCH] clear error list on enable/disable --- .../dropdown-question/dropdown-question.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/digital-components/dropdown-question/dropdown-question.vue b/src/digital-components/dropdown-question/dropdown-question.vue index 25a850d2..05f8b9a4 100644 --- a/src/digital-components/dropdown-question/dropdown-question.vue +++ b/src/digital-components/dropdown-question/dropdown-question.vue @@ -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); }