mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-22 13:13:08 +01:00
Fix inconsistent Omni input window height growth (#331233)
This commit is contained in:
@@ -642,7 +642,15 @@ export class ChatInputWindowService extends Disposable implements IChatInputWind
|
||||
let pendingBounds: IRectangle | undefined;
|
||||
let applyingBounds = false;
|
||||
const getRowHeight = () => {
|
||||
let contentHeight = Math.ceil(widget.contentHeight);
|
||||
// Measure the input's rendered height synchronously rather than
|
||||
// reading `widget.contentHeight`, which is backed by a
|
||||
// ResizeObserver and lags a frame behind. `layout()` re-lays the
|
||||
// editor synchronously, so the observable is stale until the
|
||||
// observer fires next frame; sizing the window to that stale height
|
||||
// while the editor grows (e.g. pasting text or cycling input
|
||||
// history) clips the new lines and makes the window grow
|
||||
// inconsistently until the observer catches up.
|
||||
let contentHeight = Math.ceil(widget.input.element.offsetHeight);
|
||||
if (widget.attachmentModel.size > 0) {
|
||||
contentHeight += Math.max(0, CHAT_INPUT_WINDOW_INITIAL_SURFACE_HEIGHT - widget.input.inputRowHeight);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user