Merge pull request #1585 from Safelite/feature/CSR-1710

Feature/csr 1710
This commit is contained in:
AMSNEHA 2023-11-29 17:57:19 +05:30 committed by GitHub
commit ddd75d508d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View file

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

View file

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

View file

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