aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/js/apps/issues/components/App.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/components/App.js b/server/sonar-web/src/main/js/apps/issues/components/App.js
index 984aedca11c..d0befcca5af 100644
--- a/server/sonar-web/src/main/js/apps/issues/components/App.js
+++ b/server/sonar-web/src/main/js/apps/issues/components/App.js
@@ -181,10 +181,13 @@ export default class App extends React.PureComponent {
areMyIssuesSelected(prevQuery) !== areMyIssuesSelected(query)
) {
this.fetchFirstIssues();
- } else if (prevState.selected !== this.state.selected) {
- if (!this.state.openIssue) {
- this.scrollToSelectedIssue();
- }
+ } else if (
+ !this.state.openIssue &&
+ (prevState.selected !== this.state.selected || prevState.openIssue != null)
+ ) {
+ // if user simply selected another issue
+ // or if he went from the source code back to the list of issues
+ this.scrollToSelectedIssue();
}
}