Skip to content

Commit

Permalink
Merge pull request #21552 from tienifr/fix/20865-composer-refocuses-o…
Browse files Browse the repository at this point in the history
…n-clicking-same-chat-lhn

Fix: Composer does not refocus on clicking the same chat in LHN
  • Loading branch information
MonilBhavsar authored Jul 17, 2023
2 parents bcc4166 + 37520c4 commit d0cc499
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/components/LHNOptionsList/OptionRowLHN.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ function OptionRowLHN(props) {

props.onSelectRow(optionItem, popoverAnchor);
}}
onMouseDown={(e) => {
if (!e) {
return;
}

// Prevent losing Composer focus
e.preventDefault();
}}
onSecondaryInteraction={(e) => showPopover(e)}
withoutFocusOnSecondaryInteraction
activeOpacity={0.8}
Expand Down
9 changes: 5 additions & 4 deletions src/pages/home/sidebar/SidebarLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,11 @@ class SidebarLinks extends React.Component {
* @param {String} option.reportID
*/
showReportPage(option) {
if (this.props.isCreateMenuOpen || (this.props.isSmallScreenWidth && Navigation.getTopmostReportId())) {
// Prevent opening Report page when click LHN row quickly after clicking FAB icon
// or when continuously click different LHNs, only apply to small screen since
// getTopmostReportId always returns on other devices
// Prevent opening Report page when clicking LHN row quickly after clicking FAB icon
// or when clicking the active LHN row
// or when continuously clicking different LHNs, only apply to small screen
// since getTopmostReportId always returns on other devices
if (this.props.isCreateMenuOpen || this.props.currentReportID === option.reportID || (this.props.isSmallScreenWidth && Navigation.getTopmostReportId())) {
return;
}
Navigation.navigate(ROUTES.getReportRoute(option.reportID));
Expand Down

0 comments on commit d0cc499

Please sign in to comment.