aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js
diff options
context:
space:
mode:
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>2022-08-09 15:03:45 +0200
committersonartech <sonartech@sonarsource.com>2022-08-10 10:04:06 +0000
commit51f2a5f82dab35a96ccdcee1d7e891af7f3c1394 (patch)
treeaaccd62e7f8632f0ad1c8a99d26e438432366fca /server/sonar-web/src/main/js
parent093e4bae8565e5b782ad3197a8647590b32e2293 (diff)
downloadsonarqube-51f2a5f82dab35a96ccdcee1d7e891af7f3c1394.tar.gz
sonarqube-51f2a5f82dab35a96ccdcee1d7e891af7f3c1394.zip
SONAR-16537 When switching tabs, scrolling the content back to the top
Diffstat (limited to 'server/sonar-web/src/main/js')
-rw-r--r--server/sonar-web/src/main/js/components/rules/RuleDescription.tsx3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/components/rules/RuleDescription.tsx b/server/sonar-web/src/main/js/components/rules/RuleDescription.tsx
index a3f29e3b9ff..85e8717ec26 100644
--- a/server/sonar-web/src/main/js/components/rules/RuleDescription.tsx
+++ b/server/sonar-web/src/main/js/components/rules/RuleDescription.tsx
@@ -171,6 +171,9 @@ export default class RuleDescription extends React.PureComponent<Props, State> {
markdown: isDefault,
'rule-desc': !isDefault
})}
+ ref={node => {
+ node?.scrollIntoView();
+ }}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: sanitizeString(sections[0].content)