From 6cfa0910b63b5e9e5e945bafa4bef40c519211f2 Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Mon, 12 Dec 2022 09:39:33 -0800 Subject: [PATCH] fix h-scrollbar cutoff issue (#21396) --- .../workbench/contrib/query/browser/queryEditor.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sql/workbench/contrib/query/browser/queryEditor.ts b/src/sql/workbench/contrib/query/browser/queryEditor.ts index 8108a514da..f2fdb6bf04 100644 --- a/src/sql/workbench/contrib/query/browser/queryEditor.ts +++ b/src/sql/workbench/contrib/query/browser/queryEditor.ts @@ -342,6 +342,7 @@ export class QueryEditor extends EditorPane { } this.taskbar.setContent(content); + this.layout(this.dimension); } public override async setInput(newInput: QueryEditorInput, options: IEditorOptions, context: IEditorOpenContext, token: CancellationToken): Promise { @@ -507,10 +508,12 @@ export class QueryEditor extends EditorPane { * To be called when the container of this editor changes size. */ public layout(dimension: DOM.Dimension): void { - this.dimension = dimension; - const queryEditorHeight = dimension.height - DOM.getTotalHeight(this.taskbar.getContainer()); - this.splitviewContainer.style.height = queryEditorHeight + 'px'; - this.splitview.layout(queryEditorHeight); + if (dimension?.height && dimension?.width && this.splitview) { + this.dimension = dimension; + const queryEditorHeight = dimension.height - DOM.getTotalHeight(this.taskbar.getContainer()); + this.splitviewContainer.style.height = queryEditorHeight + 'px'; + this.splitview.layout(queryEditorHeight); + } } /**