Skip to content

Commit

Permalink
fix: composer does not refocus on clicking the same chat
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Jul 12, 2023
1 parent 105ba31 commit 37520c4
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 @@ -147,6 +147,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 37520c4

Please sign in to comment.