]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-16537 When switching tabs, scrolling the content back to the top
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>
Tue, 9 Aug 2022 13:03:45 +0000 (15:03 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 10 Aug 2022 10:04:06 +0000 (10:04 +0000)
server/sonar-web/src/main/js/components/rules/RuleDescription.tsx

index a3f29e3b9ffa6444c56ac8e2d10e7a70f2325758..85e8717ec26b8ae4a1b1404b676b09ec359680a1 100644 (file)
@@ -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)