Skip to content

Commit

Permalink
Enable arrow-keys nav in toolbar on all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
tnajdek authored and mrtcode committed Nov 24, 2022
1 parent c480ec9 commit 29c047a
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/ui/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ function Toolbar({ viewMode, enableReturnButton, colorState, menuState, linkStat
);

const handleFocus = useCallback((ev) => {
if (viewMode !== 'web') {
return;
}
const candidateNodes = getCandidateNodes();
if(!candidateNodes.includes(ev.target)) {
return;
Expand All @@ -42,9 +39,6 @@ function Toolbar({ viewMode, enableReturnButton, colorState, menuState, linkStat
}, [viewMode, getCandidateNodes]);

const handleBlur = useCallback((ev) => {
if (viewMode !== 'web') {
return;
}
const candidateNodes = getCandidateNodes();
if (ev.relatedTarget?.closest('.toolbar') === toolbarRef.current) {
return;
Expand All @@ -53,9 +47,6 @@ function Toolbar({ viewMode, enableReturnButton, colorState, menuState, linkStat
}, [viewMode]);

const handleKeyDown = useCallback((ev) => {
if (viewMode !== 'web') {
return;
}
const candidateNodes = getCandidateNodes();
if (ev.key === 'ArrowLeft') {
lastFocusedIndex.current = mod((lastFocusedIndex.current - 1), candidateNodes.length);
Expand Down

0 comments on commit 29c047a

Please sign in to comment.