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

View file

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

View file

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

View file

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

View file

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