CSR-1012 refactor hide alerts on text input
This commit is contained in:
parent
a6e3c47aa9
commit
a24be0cc1d
2 changed files with 12 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue