This commit is contained in:
Sneha 2023-11-29 15:55:17 +05:30
parent 9f2fb8d591
commit 9fcd1c06ae
3 changed files with 17 additions and 0 deletions

View file

@ -29,6 +29,7 @@
<modalButtonMain
isPrimary
class="w-100"
id="modalbtn"
ref="modalButtonMain"
loaderColor="white"
:buttonText="footerButtonText"

View file

@ -11,6 +11,7 @@
:headerText="modalHeaderText"
:onModalClosedCallback="onModalClosed"
:onModalOpenedCallback="focusOnPromoInput"
@keypress.enter="onEnter"
:footerButtonText="modalFooterText"
@footer-button-event="addPromoCode">
<promoQuestion
@ -162,6 +163,10 @@ export default {
openModal() {
this.modal.openModal();
},
onEnter(e) {
e.preventDefault();
this.modal.validateAndEmit();
},
closeModal() {
this.modal.closeModal();
},

View file

@ -19,6 +19,7 @@
:onModalOpenedCallback="onModalOpened"
:onModalClosedCallback="onModalClosed"
:footerButtonText="modalFooterText"
@keypress.enter="onEnter"
@footer-button-event="setZipCode">
<serviceZipQuestion
ref="serviceZipQuestion"
@ -108,6 +109,10 @@ export default {
const input = document.getElementById(this.serviceZipCodeTextInputId);
input?.focus();
},
focusOnModalButton() {
const input = document.getElementById("modalbtn");
input?.focus();
},
copyModel(modelToCopy) {
return {
state: modelToCopy.state,
@ -117,6 +122,12 @@ export default {
openModal() {
this.modal.openModal();
},
onEnter(e) {
e.preventDefault();
this.focusOnModalButton();
this.modal.validateAndEmit();
this.focusOnZipInput();
},
closeModal() {
this.modal.closeModal();
},