Skip to content

Commit

Permalink
Merge pull request #2032 from Expensify/beaman-focusComposeWhenLHNRep…
Browse files Browse the repository at this point in the history
…ortClick

Focus compose box when LHN report clicked
  • Loading branch information
sketchydroide authored Mar 24, 2021
2 parents 6fdb61c + bca8073 commit 739d9ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ class ReportActionCompose extends React.Component {
this.comment = this.props.comment;
}

// When any modal goes from visible to hidden, bring focus to the compose field
if (prevProps.modal.isVisible && !this.props.modal.isVisible) {
// When any modal goes from visible to hidden or when the report ID changes, bring focus to the compose field
if (
(prevProps.modal.isVisible && !this.props.modal.isVisible)
|| (prevProps.reportID !== this.props.reportID)
) {
this.setIsFocused(true);
}
}
Expand Down

0 comments on commit 739d9ae

Please sign in to comment.