CSR-1012 refactor hide alerts on text input

This commit is contained in:
Matt Caimi 2023-01-23 13:23:30 -05:00
parent 4276f2b516
commit 95f2c4f8ce
2 changed files with 12 additions and 4 deletions

View file

@ -70,7 +70,6 @@ export default {
questionAlignment: String, // Left or center. Left is default.
cornerStyle: String, // Rounded or square. Square is default.
includeSearchIcon: Boolean,
customOnChange: Function,
},
setup(props) {
const propsClone = Object.assign({}, props);
@ -146,7 +145,6 @@ export default {
},
watch: {
async value(newValue) {
this.customOnChange();
const result = await validate(newValue, this.validationRules); // do a test validation check, without triggering full validation
if (result.valid) {
this.handleChange(newValue); // trigger full validation on this field only

View file

@ -19,6 +19,7 @@
<modal ref="zipCodeInputModal" :cmsWidgetName="this.modalWidgetName" :buttonClick="setZip">
<div class="ps-4 pe-4 pb-4">
<textboxQuestion
ref="zipInputTextQuestion"
:cmsWidgetName="this.textboxQuestionWidgetName"
v-model="serviceZipCodeInput"
inputId="serviceZipCodeInput"
@ -26,8 +27,7 @@
mask="#####"
isRequired
disableAutoFill
validationRules="zip-required|zip-format"
:customOnChange="this.resetsOnZipInput" />
validationRules="zip-required|zip-format" />
<alert
ref="alertInvalidZip"
v-if="displayInvalidZipAlert"
@ -145,6 +145,16 @@ export default {
return text;
},
},
mounted() {
this.$watch(
() => {
return this.$refs.zipInputTextQuestion.value;
},
(val) => {
this.resetsOnZipInput();
}
);
},
components: {
textLink,
modal,