Skip to content

Commit d49aa9a

Browse files
committed
Reset startingPosition before keyMode check
1 parent cb45e4e commit d49aa9a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

polyfill/spatnav-heuristic.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
const eventTarget = document.activeElement;
5959
const dir = ARROW_KEY_CODE[e.keyCode];
6060

61+
if (e.keyCode === TAB_KEY_CODE)
62+
spatNavManager.startingPosition = null;
63+
6164
if(!currentKeyMode ||
6265
(currentKeyMode === 'NONE') ||
6366
((currentKeyMode === 'SHIFTARROW') && !e.shiftKey) ||
@@ -78,9 +81,6 @@
7881
spatNavManager.startingPosition = null;
7982
}
8083
}
81-
82-
if (e.keyCode === TAB_KEY_CODE)
83-
spatNavManager.startingPosition = null;
8484
});
8585

8686
/**
@@ -1156,6 +1156,7 @@
11561156
(!container.parentElement && !isHTMLScrollBoundary(container, dir));
11571157
}
11581158

1159+
11591160
function findTarget(findCandidate, element, dir) {
11601161
let eventTarget = element;
11611162
let bestNextTarget = null;

0 commit comments

Comments
 (0)