fix scrolling in messages (#5732)

This commit is contained in:
Anthony Dresser
2019-05-29 15:13:56 -07:00
committed by GitHub
parent 9fc634dfe0
commit ea8aa92dd5

View File

@@ -199,9 +199,10 @@ export class MessagePanel extends Disposable {
// convert to old VS Code tree interface with expandable methods
let expandableTree: IExpandableTree = <IExpandableTree>this.tree;
if (this.state.scrollPosition) {
const previousScroll = this.state.scrollPosition;
this.tree.refresh(this.model).then(() => {
// Restore the previous scroll position when switching between tabs
expandableTree.setScrollPosition(this.state.scrollPosition);
expandableTree.setScrollPosition(previousScroll);
});
} else {
const previousScrollPosition = expandableTree.getScrollPosition();