From 8dfb92fd2af40a197d6b51f94c78526a23d037e3 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Fri, 10 May 2019 23:38:27 -0400 Subject: [PATCH] Unfocus focused elements before changing the page to reset the tab order --- resources/assets/js/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index e7d81c4..35c8b0e 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -116,6 +116,11 @@ router.beforeEach((to, from, next) => { if (store.getters.getFirstLoad) { next(); } else { + // Unfocused any focused elements + if ("activeElement" in document) { + document.activeElement.blur(); + } + // Fade the page out and scroll when moving from one page to another TweenMax.to("#router-view", 0.25, { opacity: 0,