diff --git a/src/libs/Navigation/NavigationRoot.js b/src/libs/Navigation/NavigationRoot.js index d8cb96e2c6b3..9e3cad6144dd 100644 --- a/src/libs/Navigation/NavigationRoot.js +++ b/src/libs/Navigation/NavigationRoot.js @@ -11,6 +11,8 @@ import Log from '../Log'; import StatusBar from '../StatusBar'; import useCurrentReportID from '../../hooks/useCurrentReportID'; import useWindowDimensions from '../../hooks/useWindowDimensions'; +import * as ReportActionContextMenu from '../../pages/home/report/ContextMenu/ReportActionContextMenu'; +import * as EmojiPickerAction from '../actions/EmojiPickerAction'; // https://reactnavigation.org/docs/themes const navigationTheme = { @@ -121,6 +123,10 @@ function NavigationRoot(props) { if (!state) { return; } + ReportActionContextMenu.hideContextMenu(); + ReportActionContextMenu.hideDeleteModal(); + EmojiPickerAction.hideEmojiPicker(true); + updateCurrentReportID(state); parseAndLogRoute(state); animateStatusBarBackgroundColor(); diff --git a/src/pages/home/report/ReactionList/PopoverReactionList/BasePopoverReactionList.js b/src/pages/home/report/ReactionList/PopoverReactionList/BasePopoverReactionList.js index 9303d7a5bc39..a721ab31b78e 100644 --- a/src/pages/home/report/ReactionList/PopoverReactionList/BasePopoverReactionList.js +++ b/src/pages/home/report/ReactionList/PopoverReactionList/BasePopoverReactionList.js @@ -198,6 +198,9 @@ class BasePopoverReactionList extends React.Component { * Hide the ReactionList modal popover. */ hideReactionList() { + if (!this.state.isPopoverVisible) { + return; + } this.setState({ isPopoverVisible: false, }); diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index a694c4996438..fb0f10298537 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -132,6 +132,13 @@ function ReportActionsView(props) { } }, [props.report, didSubscribeToReportTypingEvents, reportID]); + useEffect(() => { + if (isFocused || !context.reactionListRef || !context.reactionListRef.current) { + return; + } + context.reactionListRef.current.hideReactionList(); + }, [isFocused, context.reactionListRef]); + /** * Retrieves the next set of report actions for the chat once we are nearing the end of what we are currently * displaying.