Skip to content

Commit

Permalink
fix: use only auto guards
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Mar 11, 2019
1 parent 33fcd0b commit 12dab4a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Trap.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ function autoGuard(startIndex, end, step, allNodes) {
let lastGuard = null;
let i = startIndex;
do {
const node = allNodes[i];
if (node.guard) {
lastGuard = node;
} else if (node.lockItem) {
const item = allNodes[i];
if (item.guard) {
if (item.node.dataset.focusAutoGuard) {
lastGuard = item;
}
} else if (item.lockItem) {
if (i !== startIndex) {
// we will tab to the next element
return;
}
lastGuard = null;
} else {
break;
Expand Down

0 comments on commit 12dab4a

Please sign in to comment.