Skip to content

Commit

Permalink
Merge pull request #28846 from astrohunter62/a-28324
Browse files Browse the repository at this point in the history
Fix/28324 :  App keeps both right click LHN popup and delete message popup open together
  • Loading branch information
MariaHCD authored Oct 16, 2023
2 parents b808ace + fa08095 commit ebf8306
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/LHNOptionsList/OptionRowLHN.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -167,20 +169,25 @@ 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;
}

// Prevent composer blur on left click
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={[
Expand Down

0 comments on commit ebf8306

Please sign in to comment.