Bug/3731 results scroll (#4408)

* Bug 3731: Minor issues saving scroll position in results

Fixing the second part i.e. scroll position of results view while switching tabs. The resize call was not respecting the old scrolbar state. Making an explit call to set scroll position  to ensure this sets at the end.
This commit is contained in:
udeeshagautam
2019-03-13 11:03:41 -07:00
committed by GitHub
parent b2b7d18802
commit 2c7b5578e7
2 changed files with 6 additions and 0 deletions

View File

@@ -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)) {

View File

@@ -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();
}
}