From 86632aa57938e3d9e579d085af75786b6ccfd16d Mon Sep 17 00:00:00 2001 From: Gary Hemstock Date: Wed, 26 Sep 2018 10:17:39 -0400 Subject: [PATCH] [fixed] check if element exists before focusing in scopeTab helper --- src/helpers/scopeTab.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/helpers/scopeTab.js b/src/helpers/scopeTab.js index a8410ab3..b8516c4d 100644 --- a/src/helpers/scopeTab.js +++ b/src/helpers/scopeTab.js @@ -62,6 +62,10 @@ export default function scopeTab(node, event) { x += shiftKey ? -1 : 1; } + // If the tabbable element does not exist, + // let the browser control the focus + if (typeof tabbable[x] === "undefined") return; + event.preventDefault(); tabbable[x].focus();