Skip to content

Commit

Permalink
[fixed] check if element exists before focusing in scopeTab helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Hemstock authored and diasbruno committed Sep 27, 2018
1 parent 2a70831 commit 86632aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/helpers/scopeTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 86632aa

Please sign in to comment.