CSR-478 relocate keydown logic to footer

This commit is contained in:
CarlNation 2022-04-12 09:12:24 -04:00
parent 5ab1f6df06
commit 12db51a377
5 changed files with 6 additions and 10 deletions

View file

@ -70,6 +70,9 @@ export default {
beforeUnmount() { beforeUnmount() {
window.removeEventListener('resize', this.onResize); window.removeEventListener('resize', this.onResize);
}, },
unmounted() {
document.onkeydown = null;
},
computed: { computed: {
backLink(){ backLink(){
return this.getCmsContent(this.cmsWidgetName, 'BackButtonText'); return this.getCmsContent(this.cmsWidgetName, 'BackButtonText');
@ -89,6 +92,9 @@ export default {
this.$refs.buttonMain.removeLoader(); this.$refs.buttonMain.removeLoader();
}, },
buttonClick() { buttonClick() {
document.onkeydown = function (e) {
return false;
};
this.$emit("ForwardClicked"); this.$emit("ForwardClicked");
}, },
linkClick() { linkClick() {

View file

@ -814,7 +814,6 @@ function setupMocks({
damageLocationQuestion.methods.initializeComponent; damageLocationQuestion.methods.initializeComponent;
wrapper.vm.setCmsContent = baseMixin.methods.setCmsContent; wrapper.vm.setCmsContent = baseMixin.methods.setCmsContent;
wrapper.vm.blockKeyDownInputFromKeyboard = baseMixin.methods.blockKeyDownInputFromKeyboard;
return { wrapper, apiPromise }; return { wrapper, apiPromise };
} }

View file

@ -258,8 +258,6 @@ export default {
}, },
async forwardButtonAction() { async forwardButtonAction() {
this.blockKeyDownInputFromKeyboard();
store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair); store.commit(this.storeMutations.UPDATE_IS_REPAIR, this.isWindshieldRepair);
if (this.isWindshieldRepair){ if (this.isWindshieldRepair){

View file

@ -25,11 +25,6 @@ export default {
return store.dispatch(type, payload); return store.dispatch(type, payload);
}, },
blockKeyDownInputFromKeyboard(){
document.onkeydown = function (e) {
return false;
};
},
savePageDataToStore(page, data){ savePageDataToStore(page, data){
store.commit(storeMutations.UPDATE_PAGE_DATA, { page: page, data: data }); store.commit(storeMutations.UPDATE_PAGE_DATA, { page: page, data: data });
}, },

View file

@ -34,8 +34,6 @@ const routes = [
path: "/", path: "/",
name: "root", name: "root",
async beforeEnter(to, from, next) { async beforeEnter(to, from, next) {
document.onkeydown = null;
// If we have no query string, or we don't have the FmgPage query string. // If we have no query string, or we don't have the FmgPage query string.
if (to.query.fmgPage === undefined) { if (to.query.fmgPage === undefined) {
await GoToFunnelStartOn404(next); await GoToFunnelStartOn404(next);