Skip to content

Commit

Permalink
Merge pull request #34089 from Expensify/revert-33483-fix/32970-don't…
Browse files Browse the repository at this point in the history
…-focus-if-popover-visible

Revert "Fix composer is focused after opening another popover"

(cherry picked from commit 57c6c2f)
  • Loading branch information
stitesExpensify authored and OSBotify committed Jan 8, 2024
1 parent 1fb4386 commit d1b8388
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {findNodeHandle, InteractionManager, NativeModules, View} from 'react-nat
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import Composer from '@components/Composer';
import {PopoverContext} from '@components/PopoverProvider';
import withKeyboardState from '@components/withKeyboardState';
import useLocalize from '@hooks/useLocalize';
import usePrevious from '@hooks/usePrevious';
Expand Down Expand Up @@ -108,7 +107,6 @@ function ComposerWithSuggestions({
// For testing
children,
}) {
const {isOpen: isPopoverOpen} = React.useContext(PopoverContext);
const theme = useTheme();
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
Expand Down Expand Up @@ -411,15 +409,9 @@ function ComposerWithSuggestions({
* @param {Boolean} [shouldDelay=false] Impose delay before focusing the composer
* @memberof ReportActionCompose
*/
const focus = useCallback(
(shouldDelay = false) => {
if (isPopoverOpen) {
return;
}
focusComposerWithDelay(textInputRef.current)(shouldDelay);
},
[isPopoverOpen],
);
const focus = useCallback((shouldDelay = false) => {
focusComposerWithDelay(textInputRef.current)(shouldDelay);
}, []);

const setUpComposeFocusManager = useCallback(() => {
// This callback is used in the contextMenuActions to manage giving focus back to the compose input.
Expand Down

0 comments on commit d1b8388

Please sign in to comment.