diff --git a/src/components/LHNOptionsList/OptionRowLHN.js b/src/components/LHNOptionsList/OptionRowLHN.js index 4e6564646cac..17c2ef0c1998 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.js +++ b/src/components/LHNOptionsList/OptionRowLHN.js @@ -26,7 +26,9 @@ import * as ReportUtils from '../../libs/ReportUtils'; import useLocalize from '../../hooks/useLocalize'; import Permissions from '../../libs/Permissions'; import Tooltip from '../Tooltip'; +import DomUtils from '../../libs/DomUtils'; import useWindowDimensions from '../../hooks/useWindowDimensions'; +import ReportActionComposeFocusManager from '../../libs/ReportActionComposeFocusManager'; const propTypes = { /** Style for hovered state */ @@ -167,12 +169,13 @@ function OptionRowLHN(props) { if (e) { e.preventDefault(); } - + // Enable Composer to focus on clicking the same chat after opening the context menu. + ReportActionComposeFocusManager.focus(); props.onSelectRow(optionItem, popoverAnchor); }} onMouseDown={(e) => { // Allow composer blur on right click - if (!e || e.button === 2) { + if (!e) { return; } @@ -180,7 +183,11 @@ function OptionRowLHN(props) { e.preventDefault(); }} testID={optionItem.reportID} - onSecondaryInteraction={(e) => showPopover(e)} + onSecondaryInteraction={(e) => { + showPopover(e); + // Ensure that we blur the composer when opening context menu, so that only one component is focused at a time + DomUtils.getActiveElement().blur(); + }} withoutFocusOnSecondaryInteraction activeOpacity={0.8} style={[