Skip to content

Commit

Permalink
Remove focus when scrolling (#94280)
Browse files Browse the repository at this point in the history
Co-authored-by: João Moreno <joao.moreno@microsoft.com>
  • Loading branch information
shskwmt and joaomoreno committed Nov 5, 2020
1 parent 544c986 commit 8fe4a34
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vs/base/browser/ui/list/listWidget.ts
Expand Up @@ -1456,6 +1456,7 @@ export class List<T> implements ISpliceable<T>, IThemable, IDisposable {
this.setFocus([lastPageIndex], browserEvent);
}
} else {
this.setFocus([]);
const previousScrollTop = this.view.getScrollTop();
this.view.setScrollTop(previousScrollTop + this.view.renderHeight - this.view.elementHeight(lastPageIndex));

Expand Down Expand Up @@ -1488,6 +1489,7 @@ export class List<T> implements ISpliceable<T>, IThemable, IDisposable {
this.setFocus([firstPageIndex], browserEvent);
}
} else {
this.setFocus([]);
const previousScrollTop = scrollTop;
this.view.setScrollTop(scrollTop - this.view.renderHeight);

Expand Down

0 comments on commit 8fe4a34

Please sign in to comment.