Skip to content

Commit 43a148e

Browse files
author
Loïc Mangeonjean
committed
fix: fi notebook layout position
1 parent 9560d9b commit 43a148e

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= <loic@coderpad.io>
3+
Date: Mon, 10 Nov 2025 12:17:35 +0100
4+
Subject: [PATCH] fix: fix notebook layout position when container is not at
5+
(0,0)
6+
7+
---
8+
.../contrib/notebook/browser/notebookEditorWidget.ts | 5 ++---
9+
1 file changed, 2 insertions(+), 3 deletions(-)
10+
11+
diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts
12+
index 21f59261f2b..36ff30355c7 100644
13+
--- a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts
14+
+++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts
15+
@@ -1980,9 +1980,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
16+
return;
17+
}
18+
19+
- const elementContainerRect = this._overlayContainer.parentElement?.getBoundingClientRect();
20+
- this._overlayContainer.style.top = `${this._shadowElementViewInfo.top - (elementContainerRect?.top || 0)}px`;
21+
- this._overlayContainer.style.left = `${this._shadowElementViewInfo.left - (elementContainerRect?.left || 0)}px`;
22+
+ this._overlayContainer.style.top = `${this._shadowElementViewInfo.top}px`;
23+
+ this._overlayContainer.style.left = `${this._shadowElementViewInfo.left}px`;
24+
this._overlayContainer.style.width = `${dimension ? dimension.width : this._shadowElementViewInfo.width}px`;
25+
this._overlayContainer.style.height = `${dimension ? dimension.height : this._shadowElementViewInfo.height}px`;
26+
}

0 commit comments

Comments
 (0)