From a4bb18bf2e7dee17af8ae2974f47a9f8909a638b Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 10 Oct 2017 17:50:55 +0200 Subject: SONAR-9698 Left-arrow to issues list doesn't scroll to right place --- server/sonar-web/src/main/js/apps/issues/components/App.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'server/sonar-web/src') 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(); } } -- cgit v1.2.3