Skip to content

Commit

Permalink
set the header as focused index
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Oct 24, 2024
1 parent 9a4742d commit 8cd287d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/EmojiPicker/EmojiPickerMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function EmojiPickerMenu({onEmojiSelected, activeEmoji}: EmojiPickerMenuProps, r
emojiListRef,
spacersIndexes,
} = useEmojiPickerMenu();
console.log('header', headerEmojis, headerRowIndices)

Check failure on line 54 in src/components/EmojiPicker/EmojiPickerMenu/index.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Unexpected console statement

Check failure on line 54 in src/components/EmojiPicker/EmojiPickerMenu/index.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Insert `;`

// Ref for the emoji search input
const searchInputRef = useRef<BaseTextInputRef>(null);
Expand Down Expand Up @@ -236,8 +237,9 @@ function EmojiPickerMenu({onEmojiSelected, activeEmoji}: EmojiPickerMenuProps, r

const calculatedOffset = Math.floor(headerIndex / CONST.EMOJI_NUM_PER_ROW) * CONST.EMOJI_PICKER_HEADER_HEIGHT;
emojiListRef.current?.scrollToOffset({offset: calculatedOffset, animated: true});
setFocusedIndex(headerIndex);
},
[emojiListRef],
[emojiListRef, setFocusedIndex],
);

/**
Expand Down

0 comments on commit 8cd287d

Please sign in to comment.