diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-10 17:50:55 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-11 12:02:21 +0200 |
commit | a4bb18bf2e7dee17af8ae2974f47a9f8909a638b (patch) | |
tree | 4ab0514425a0e921116c16772d0bc9744683012b /server/sonar-web/src/main/js | |
parent | 57606ff108c1c541f3e152a31bbbfdc0261b2dc6 (diff) | |
download | sonarqube-a4bb18bf2e7dee17af8ae2974f47a9f8909a638b.tar.gz sonarqube-a4bb18bf2e7dee17af8ae2974f47a9f8909a638b.zip |
SONAR-9698 Left-arrow to issues list doesn't scroll to right place
Diffstat (limited to 'server/sonar-web/src/main/js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/issues/components/App.js | 11 |
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(); } } |