From 82fa188a2df93862d35995fddfaf19e38e8fd490 Mon Sep 17 00:00:00 2001 From: Tomasz Misiukiewicz Date: Mon, 5 Feb 2024 08:46:03 +0100 Subject: [PATCH] fix focusing emoji search input on mweb --- src/components/EmojiPicker/EmojiPickerMenu/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/EmojiPicker/EmojiPickerMenu/index.js b/src/components/EmojiPicker/EmojiPickerMenu/index.js index cbf55b31c74d..d05a39160916 100755 --- a/src/components/EmojiPicker/EmojiPickerMenu/index.js +++ b/src/components/EmojiPicker/EmojiPickerMenu/index.js @@ -91,11 +91,11 @@ function EmojiPickerMenu({forwardedRef, onEmojiSelected}) { } // If the input is not focused and the new index is out of range, focus the input - if (newIndex < 0 && !searchInputRef.current.isFocused()) { + if (newIndex < 0 && !searchInputRef.current.isFocused() && shouldFocusInputOnScreenFocus) { searchInputRef.current.focus(); } }, - [filteredEmojis.length, highlightFirstEmoji, isUsingKeyboardMovement], + [filteredEmojis.length, highlightFirstEmoji, isUsingKeyboardMovement, shouldFocusInputOnScreenFocus], ); const disabledIndexes = useMemo(() => (isListFiltered ? [] : [...headerIndices, ...spacersIndexes]), [headerIndices, isListFiltered, spacersIndexes]);