Merge pull request #2080 from Safelite/feature/CSR-2308

CSR-2308
This commit is contained in:
AMSNEHA 2024-11-07 15:41:51 +05:30 committed by GitHub
commit ca4e136bca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,6 +73,11 @@ export default {
resetForm, resetForm,
}; };
}, },
data() {
return {
isEnterClicked: false,
};
},
methods: { methods: {
async validateAndEmit() { async validateAndEmit() {
const validationResult = await this.validate(); const validationResult = await this.validate();
@ -84,9 +89,14 @@ export default {
}, },
async onEnter(e) { async onEnter(e) {
e.preventDefault(); e.preventDefault();
if (this.isEnterClicked) return;
this.isEnterClicked = true;
document.getElementById("modalbtn")?.focus(); document.getElementById("modalbtn")?.focus();
this.$refs.modalButtonMain.clicked(); this.$refs.modalButtonMain.clicked();
document.getElementById(this.modalId)?.focus(); document.getElementById(this.modalId)?.focus();
setTimeout(() => {
this.isEnterClicked = false;
}, 2000);
}, },
resetButtonStyle() { resetButtonStyle() {
this.$refs.modalButtonMain?.resetButtonStyle(); this.$refs.modalButtonMain?.resetButtonStyle();