Skip to content

Commit

Permalink
[fixed] if tabbable element is undefined, focus head or tail based on…
Browse files Browse the repository at this point in the history
… shiftKey
  • Loading branch information
DarudeGarystorm authored and diasbruno committed Sep 27, 2018
1 parent 86632aa commit 1b561fc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/helpers/scopeTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ export default function scopeTab(node, event) {
}

// If the tabbable element does not exist,
// let the browser control the focus
if (typeof tabbable[x] === "undefined") return;
// focus head/tail based on shiftKey
if (typeof tabbable[x] === "undefined") {
event.preventDefault();
target = shiftKey ? tail : head;
target.focus();
return;
}

event.preventDefault();

Expand Down

0 comments on commit 1b561fc

Please sign in to comment.