Skip to content

Commit 231deb1

Browse files
authored
Fix inline chat widget collapsing when removing attachments (microsoft#227167)
Fix microsoft/vscode-copilot#7661
1 parent 777c2ac commit 231deb1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/workbench/contrib/chat/browser/chatInputPart.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
516516
onDidChangeCursorPosition();
517517
}
518518

519-
private initAttachedContext(container: HTMLElement) {
519+
private initAttachedContext(container: HTMLElement, isLayout = false) {
520520
const oldHeight = container.offsetHeight;
521521
dom.clearNode(container);
522522
this.attachedContextDisposables.clear();
@@ -578,7 +578,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
578578
this.attachedContextDisposables.add(disp);
579579
});
580580

581-
if (oldHeight !== container.offsetHeight) {
581+
if (oldHeight !== container.offsetHeight && !isLayout) {
582582
this._onDidChangeHeight.fire();
583583
}
584584
}
@@ -609,7 +609,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
609609

610610
private previousInputEditorDimension: IDimension | undefined;
611611
private _layout(height: number, width: number, allowRecurse = true): void {
612-
this.initAttachedContext(this.attachedContextContainer);
612+
this.initAttachedContext(this.attachedContextContainer, true);
613613

614614
const data = this.getLayoutData();
615615

0 commit comments

Comments
 (0)