From bca8073dc8507cf32fbf72e71891d37044c3eb39 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Wed, 24 Mar 2021 17:00:30 +0200 Subject: [PATCH] Focus compose box when LHN report clicked --- src/pages/home/report/ReportActionCompose.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 7bc8c8761c02..3b54b649cbbf 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -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); } }