Update blur for this one textbox
This commit is contained in:
parent
9802f185fd
commit
e25ff4d2c2
3 changed files with 15 additions and 9 deletions
|
|
@ -47,7 +47,7 @@
|
||||||
:data-bs-toggle="includeSelectIcon ? 'modal' : ''"
|
:data-bs-toggle="includeSelectIcon ? 'modal' : ''"
|
||||||
:data-bs-target="'#' + cmsWidgetName"
|
:data-bs-target="'#' + cmsWidgetName"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
@blur="handleChange"
|
@blur="blurPlus"
|
||||||
@focus="$emit('focus', $event.target.value)"
|
@focus="$emit('focus', $event.target.value)"
|
||||||
@paste="trimOnPaste"
|
@paste="trimOnPaste"
|
||||||
@drop="trimOnPaste" />
|
@drop="trimOnPaste" />
|
||||||
|
|
@ -92,7 +92,7 @@ export default {
|
||||||
buttonMain
|
buttonMain
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
alwaysEmitFieldErrorOnClick: {
|
alwaysEmitFieldErrorOnEvent: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
|
@ -222,6 +222,12 @@ export default {
|
||||||
this.$emit('textboxQuestionEvent.inputIdAssigned', this.inputId);
|
this.$emit('textboxQuestionEvent.inputIdAssigned', this.inputId);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
blurPlus() {
|
||||||
|
this.handleChange(this.value);
|
||||||
|
if (this.alwaysEmitFieldErrorOnEvent) {
|
||||||
|
this.$emit('field-has-error', !this.meta.valid);
|
||||||
|
}
|
||||||
|
},
|
||||||
trimOnPaste(evt) {
|
trimOnPaste(evt) {
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
@ -258,7 +264,7 @@ export default {
|
||||||
if (result.valid) {
|
if (result.valid) {
|
||||||
this.handleChange(this.value);
|
this.handleChange(this.value);
|
||||||
this.$emit('click-event');
|
this.$emit('click-event');
|
||||||
} else if (this.alwaysEmitFieldErrorOnClick) {
|
} else if (this.alwaysEmitFieldErrorOnEvent) {
|
||||||
this.$emit('field-has-error', true);
|
this.$emit('field-has-error', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -173,10 +173,10 @@ const getAvailableDates = async (
|
||||||
if (storeAction.storeAction === GET_SHOP_TIME_SLOTS) {
|
if (storeAction.storeAction === GET_SHOP_TIME_SLOTS) {
|
||||||
if (storeAction.payload.providerNumber) {
|
if (storeAction.payload.providerNumber) {
|
||||||
timeSlotsResponse = await useMainStore().getShopTimeSlots(
|
timeSlotsResponse = await useMainStore().getShopTimeSlots(
|
||||||
storeAction.payload.startDate,
|
storeAction.payload.startDate,
|
||||||
storeAction.payload.endDate,
|
storeAction.payload.endDate,
|
||||||
storeAction.payload.shopAppointmentType,
|
storeAction.payload.shopAppointmentType,
|
||||||
storeAction.payload.providerNumber
|
storeAction.payload.providerNumber
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (storeAction.payload?.zipCodeOverride) {
|
} else if (storeAction.payload?.zipCodeOverride) {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<textboxQuestion
|
<textboxQuestion
|
||||||
ref="zipInputTextQuestion"
|
ref="zipInputTextQuestion"
|
||||||
v-model="internalZipcode"
|
v-model="internalZipcode"
|
||||||
:alwaysEmitFieldErrorOnClick="true"
|
:alwaysEmitFieldErrorOnEvent="true"
|
||||||
:cmsWidgetName="cmsWidgetName"
|
:cmsWidgetName="cmsWidgetName"
|
||||||
inputId="serviceZipCode"
|
inputId="serviceZipCode"
|
||||||
cornerStyle="rounded"
|
cornerStyle="rounded"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue