From dc434fd69383c3d00c675ff2e3f22d07f480a7a4 Mon Sep 17 00:00:00 2001 From: David Cho-Lerat Date: Thu, 18 Jan 2024 12:07:13 +0100 Subject: [PATCH] SONAR-21348 Rule details: do not switch back to "Why" tab when refocusing browser window --- .../sonar-web/src/main/js/components/rules/RuleTabViewer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/sonar-web/src/main/js/components/rules/RuleTabViewer.tsx b/server/sonar-web/src/main/js/components/rules/RuleTabViewer.tsx index 9eb242e86a8..5059ccfb518 100644 --- a/server/sonar-web/src/main/js/components/rules/RuleTabViewer.tsx +++ b/server/sonar-web/src/main/js/components/rules/RuleTabViewer.tsx @@ -107,7 +107,9 @@ export class RuleTabViewer extends React.PureComponent this.computeState(pState, prevProps.ruleDetails !== ruleDetails)); + this.setState((pState) => + this.computeState(pState, prevProps.ruleDetails.key !== ruleDetails.key), + ); } if (selectedTab?.value === TabKeys.MoreInfo) { -- 2.39.5