]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21348 Rule details: do not switch back to "Why" tab when refocusing browser...
authorDavid Cho-Lerat <david.cho-lerat@sonarsource.com>
Thu, 18 Jan 2024 11:07:13 +0000 (12:07 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 18 Jan 2024 20:03:23 +0000 (20:03 +0000)
server/sonar-web/src/main/js/components/rules/RuleTabViewer.tsx

index 9eb242e86a8442b4bd46ef36fe7d2fa5d169605c..5059ccfb51864359a724f94a69f435682f7a883d 100644 (file)
@@ -107,7 +107,9 @@ export class RuleTabViewer extends React.PureComponent<RuleTabViewerProps, State
       !isEqual(prevProps.ruleDetails, ruleDetails) ||
       !isEqual(prevProps.currentUser, currentUser)
     ) {
-      this.setState((pState) => this.computeState(pState, prevProps.ruleDetails !== ruleDetails));
+      this.setState((pState) =>
+        this.computeState(pState, prevProps.ruleDetails.key !== ruleDetails.key),
+      );
     }
 
     if (selectedTab?.value === TabKeys.MoreInfo) {