aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorRevanshu Paliwal <revanshu.paliwal@sonarsource.com>2022-08-11 18:16:15 +0200
committersonartech <sonartech@sonarsource.com>2022-08-11 20:03:49 +0000
commitc6d156af2906cd629a6a936b2eaa6fc1e213d79f (patch)
treee9abc353767d713e5b77f08713cb62e9d0ac32b0 /server/sonar-web
parent9222cefe3e695b6db257c9a1b55a7a7b5e6fe6b7 (diff)
downloadsonarqube-c6d156af2906cd629a6a936b2eaa6fc1e213d79f.tar.gz
sonarqube-c6d156af2906cd629a6a936b2eaa6fc1e213d79f.zip
SONAR-16537 Fixing tab scroll issue when changing tabs
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/components/rules/TabViewer.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/components/rules/TabViewer.tsx b/server/sonar-web/src/main/js/components/rules/TabViewer.tsx
index c54cea37523..f03307c16ed 100644
--- a/server/sonar-web/src/main/js/components/rules/TabViewer.tsx
+++ b/server/sonar-web/src/main/js/components/rules/TabViewer.tsx
@@ -313,7 +313,10 @@ export class TabViewer extends React.PureComponent<TabViewerProps, State> {
maxHeight: scrollInTab ? `calc(100vh - ${top + 100}px)` : 'initial'
}}
className="bordered display-flex-column">
- <div className="overflow-y-auto spacer">{tabContent}</div>
+ {/* Adding a key to force re-rendering of the tab container, so that it resets the scroll position */}
+ <div className="overflow-y-auto spacer" key={selectedTab.key}>
+ {tabContent}
+ </div>
</div>
)}
</ScreenPositionHelper>