Skip to content

Commit

Permalink
Focus compose box when LHN report clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
Beamanator committed Mar 24, 2021
1 parent 7a66773 commit bca8073
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 bca8073

Please sign in to comment.