Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Composer is not focused when press Message User in Profile page #30973

Merged
merged 15 commits into from
Dec 1, 2023
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ function ComposerWithSuggestions({
const prevIsModalVisible = usePrevious(modal.isVisible);
const prevIsFocused = usePrevious(isFocused);
useEffect(() => {
console.log('abcdef');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it accidentally added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad! Removed!

if (modal.isVisible && !prevIsModalVisible) {
// eslint-disable-next-line no-param-reassign
isNextModalWillOpenRef.current = false;
Expand All @@ -507,8 +508,7 @@ function ComposerWithSuggestions({
return;
}
focus(true);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [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
Expand Down