Skip to content

Commit

Permalink
removed extra code
Browse files Browse the repository at this point in the history
  • Loading branch information
jeet-dhandha committed Oct 4, 2023
1 parent 3828277 commit f070f8b
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -449,19 +449,13 @@ function ComposerWithSuggestions({
}, []);

const focusWithScrolledToBottom = useCallback(() => {
if (!textInputRef.current || !willBlurTextInputOnTapOutside) {
// Using `shouldAutoFocus` check to determine whether the component should be focused or not.
if (!textInputRef.current || !willBlurTextInputOnTapOutside || !shouldAutoFocus) {
return;
}

InteractionManager.runAfterInteractions(() => {
// Using `shouldAutoFocus` check to determine whether the component should be focused or not.
// Also handled Mobile Safari case, where the input should scroll to bottom and focus.
if (!shouldAutoFocus) {
return;
}

updateMultilineInputRange(textInputRef.current);

focus(); // This will focus the composer after its fully rendered.
});
}, [focus, shouldAutoFocus]);
Expand Down

0 comments on commit f070f8b

Please sign in to comment.