Skip to content

Commit

Permalink
Merge pull request #30973 from tienifr/fix/30254
Browse files Browse the repository at this point in the history
Fix: Composer is not focused when press Message User in Profile page
  • Loading branch information
Gonals authored Dec 1, 2023
2 parents e6f2585 + a08dadd commit 2e8de3f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ function ComposerWithSuggestions({
// We want to focus or refocus the input when a modal has been closed or the underlying screen is refocused.
// We avoid doing this on native platforms since the software keyboard popping
// open creates a jarring and broken UX.
if (!(willBlurTextInputOnTapOutside && !isNextModalWillOpenRef.current && !modal.isVisible && isFocused && (prevIsModalVisible || !prevIsFocused))) {
if (!((willBlurTextInputOnTapOutside || shouldAutoFocus) && !isNextModalWillOpenRef.current && !modal.isVisible && isFocused && (prevIsModalVisible || !prevIsFocused))) {
return;
}

Expand All @@ -498,7 +498,8 @@ function ComposerWithSuggestions({
return;
}
focus(true);
}, [focus, prevIsFocused, editFocused, prevIsModalVisible, isFocused, modal.isVisible, isNextModalWillOpenRef]);
}, [focus, prevIsFocused, editFocused, prevIsModalVisible, isFocused, modal.isVisible, isNextModalWillOpenRef, shouldAutoFocus]);

useEffect(() => {
// Scrolls the composer to the bottom and sets the selection to the end, so that longer drafts are easier to edit
updateMultilineInputRange(textInputRef.current, shouldAutoFocus);
Expand Down

0 comments on commit 2e8de3f

Please sign in to comment.