Skip to content

Commit

Permalink
Merge pull request #30092 from s-alves10/fix/issue-30083
Browse files Browse the repository at this point in the history
fix: update first emoji index on mount
(cherry picked from commit ccc5e3c)
  • Loading branch information
AndrewGable authored and OSBotify committed Oct 20, 2023
1 parent e0212e6 commit 106090d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/EmojiPicker/EmojiPickerMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,17 @@ function EmojiPickerMenu(props) {
}

setupEventHandlers();
updateFirstNonHeaderIndex(emojis.current);

return () => {
cleanupEventHandlers();
};
}, [forwardedRef, shouldFocusInputOnScreenFocus, cleanupEventHandlers, setupEventHandlers]);

useEffect(() => {
// Find and store index of the first emoji item on mount
updateFirstNonHeaderIndex(emojis.current);
}, []);

const scrollToHeader = useCallback((headerIndex) => {
if (!emojiListRef.current) {
return;
Expand Down

0 comments on commit 106090d

Please sign in to comment.