Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/hooks/useArrowKeyFocusManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ export default function useArrowKeyFocusManager({
}
const nextIndex = disableCyclicTraversal ? -1 : maxIndex;
setHasKeyBeenPressed?.();
setFocusedIndex((actualIndexParam) => {
const actualIndex = actualIndexParam;
setFocusedIndex((actualIndex) => {
Comment thread
luacmartins marked this conversation as resolved.
Resolved
const currentFocusedIndex = actualIndex > 0 ? actualIndex - (itemsPerRow ?? 1) : nextIndex;
let newFocusedIndex = currentFocusedIndex;

Expand Down Expand Up @@ -127,9 +126,8 @@ export default function useArrowKeyFocusManager({

const nextIndex = disableCyclicTraversal ? maxIndex : 0;

setFocusedIndex((actualIndexParam) => {
setFocusedIndex((actualIndex) => {
let currentFocusedIndex = -1;
const actualIndex = actualIndexParam;

if (actualIndex === -1) {
currentFocusedIndex = 0;
Expand Down
Loading