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/28324 : App keeps both right click LHN popup and delete message popup open together #28846

Merged
merged 8 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add an explanatory comment here? I don't think it will be immediately clear for future contributors what we're doing here - same for the other line.

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
Loading