Added onShownCallback property and handler
This commit is contained in:
parent
f0c655cdd6
commit
338d9b7935
2 changed files with 13 additions and 4 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div
|
<div
|
||||||
class="modal fade modal-component"
|
class="modal fade modal-component"
|
||||||
v-on="{ 'hidden.bs.modal': resetButtonStyle }"
|
v-on="{ 'hidden.bs.modal': resetButtonStyle, 'shown.bs.modal': onShownCallback }"
|
||||||
:id="cmsWidgetName"
|
:id="cmsWidgetName"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
aria-labelledby="ModalComponentLabel"
|
aria-labelledby="ModalComponentLabel"
|
||||||
|
|
@ -49,6 +49,9 @@ export default {
|
||||||
name: "modal",
|
name: "modal",
|
||||||
props: {
|
props: {
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
|
onShownCallback: {
|
||||||
|
type: Function,
|
||||||
|
},
|
||||||
|
|
||||||
footerButtonCallback: {
|
footerButtonCallback: {
|
||||||
type: Function,
|
type: Function,
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,13 @@
|
||||||
href="#!"
|
href="#!"
|
||||||
data-bs-toggle="modal"
|
data-bs-toggle="modal"
|
||||||
:data-bs-target="getModalId"
|
:data-bs-target="getModalId"
|
||||||
aria-label="Modal window"
|
aria-label="Modal window" />
|
||||||
@click-event="onModalOpen" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<modal
|
<modal
|
||||||
ref="zipCodeInputModal"
|
ref="zipCodeInputModal"
|
||||||
:cmsWidgetName="this.modalWidgetName"
|
:cmsWidgetName="this.modalWidgetName"
|
||||||
|
:onShownCallback="onModalOpen"
|
||||||
:footerButtonCallback="setZip">
|
:footerButtonCallback="setZip">
|
||||||
<div class="ps-4 pe-4 pb-4">
|
<div class="ps-4 pe-4 pb-4">
|
||||||
<textboxQuestion
|
<textboxQuestion
|
||||||
|
|
@ -62,6 +62,7 @@ import textboxQuestion from "@/digital-components/textbox-question/textbox-quest
|
||||||
import { defineRule } from "vee-validate";
|
import { defineRule } from "vee-validate";
|
||||||
import { required, regex } from "@/helpers/validation-rules";
|
import { required, regex } from "@/helpers/validation-rules";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
|
import { isNoUnitNumericStyleProp } from "@vue/shared";
|
||||||
|
|
||||||
// Define Validation Rules
|
// Define Validation Rules
|
||||||
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
|
||||||
|
|
@ -104,7 +105,12 @@ export default {
|
||||||
this.$refs.zipCodeInputModal.resetButtonStyle();
|
this.$refs.zipCodeInputModal.resetButtonStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
focusOnZipInput() {},
|
focusOnZipInput() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const input = this.$refs.zipInputTextQuestion.$refs.serviceZipCodeInput;
|
||||||
|
input.focus();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
onModalOpen() {
|
onModalOpen() {
|
||||||
this.serviceZipCodeInput = this.serviceZip;
|
this.serviceZipCodeInput = this.serviceZip;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue