diff --git a/src/sql/parts/query/editor/gridPanel.ts b/src/sql/parts/query/editor/gridPanel.ts index c80d5cbe47..4a918df878 100644 --- a/src/sql/parts/query/editor/gridPanel.ts +++ b/src/sql/parts/query/editor/gridPanel.ts @@ -202,6 +202,10 @@ export class GridPanel extends ViewletPanel { } } + public resetScrollPosition() : void { + this.splitView.setScrollPosition(this.state.scrollPosition); + } + private onResultSet(resultSet: azdata.ResultSetSummary | azdata.ResultSetSummary[]) { let resultsToAdd: azdata.ResultSetSummary[]; if (!Array.isArray(resultSet)) { diff --git a/src/sql/parts/query/editor/queryResultsView.ts b/src/sql/parts/query/editor/queryResultsView.ts index b90dffadbd..6ca78e392d 100644 --- a/src/sql/parts/query/editor/queryResultsView.ts +++ b/src/sql/parts/query/editor/queryResultsView.ts @@ -108,6 +108,8 @@ class ResultsView extends Disposable implements IPanelView { this.currentDimension = dimension; if (this.needsGridResize) { this.panelViewlet.resizePanel(this.gridPanel, this.state.gridPanelSize || Math.round(this.currentDimension.height * .7)); + // we have the right scroll position saved as part of gridPanel state, use this to re-position scrollbar + this.gridPanel.resetScrollPosition(); } }