Skip to content

Commit

Permalink
Merge pull request Expensify#29949 from DylanDylann/fix/28379-search-…
Browse files Browse the repository at this point in the history
…text-is-not-selected-in-emoji-search

Fix/28379: Remove auto select text search emoji
  • Loading branch information
MariaHCD authored Oct 20, 2023
2 parents 69119aa + e4bcfa2 commit 9e1f190
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/components/EmojiPicker/EmojiPickerMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ function EmojiPickerMenu(props) {
const [selection, setSelection] = useState({start: 0, end: 0});
const [isFocused, setIsFocused] = useState(false);
const [isUsingKeyboardMovement, setIsUsingKeyboardMovement] = useState(false);
const [selectTextOnFocus, setSelectTextOnFocus] = useState(false);

useEffect(() => {
const emojisAndHeaderRowIndices = getEmojisAndHeaderRowIndices();
Expand Down Expand Up @@ -162,8 +161,6 @@ function EmojiPickerMenu(props) {
if (!searchInputRef.current) {
return;
}

setSelectTextOnFocus(true);
searchInputRef.current.focus();
}

Expand Down Expand Up @@ -323,11 +320,7 @@ function EmojiPickerMenu(props) {

// We allow typing in the search box if any key is pressed apart from Arrow keys.
if (searchInputRef.current && !searchInputRef.current.isFocused()) {
setSelectTextOnFocus(false);
searchInputRef.current.focus();

// Re-enable selection on the searchInput
setSelectTextOnFocus(true);
}
},
[filteredEmojis, highlightAdjacentEmoji, highlightedIndex, isFocused, onEmojiSelected, preferredSkinTone],
Expand Down Expand Up @@ -481,7 +474,6 @@ function EmojiPickerMenu(props) {
defaultValue=""
ref={searchInputRef}
autoFocus={shouldFocusInputOnScreenFocus}
selectTextOnFocus={selectTextOnFocus}
onSelectionChange={onSelectionChange}
onFocus={() => {
setHighlightedIndex(-1);
Expand Down

0 comments on commit 9e1f190

Please sign in to comment.