From 08faa692565b71a783f5456d0bc60a21f3763f8f Mon Sep 17 00:00:00 2001 From: Kelly Yang <124ykl@gmail.com> Date: Fri, 19 Dec 2025 16:52:35 -0800 Subject: [PATCH] fix: 3d resize vertically (#7621) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Fix an issue #7620 where 3D nodes could be resized vertically only in the expanding direction but could not be shrunk. ## Changes - **What**: - Allow the 3D node content container to shrink by removing `h-full` and adding `min-h-0 flex-1`. - Prevent the internal canvas from reasserting its previous height during parent resize by avoiding `h-full` and constraining it with `max-h-full`. - **Dependencies**: - None ## Review Focus - Verify that vertical resize works in both directions for 3D nodes. - Ensure the canvas still resizes correctly with the node and that three.js rendering is unaffected. - Confirm no regression in pointer events, overlays, or resize handles. ## Screenshots before https://github.com/user-attachments/assets/6b9e3bb0-98eb-4b06-adb3-b3aab60a7f86 after https://github.com/user-attachments/assets/76d1a962-6cdc-4ca4-941e-7a3874629b29 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7621-fix-3d-resize-vertically-2cd6d73d365081efb281e8a40c87bf9e) by [Unito](https://www.unito.io) --- src/extensions/core/load3d/Load3d.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/extensions/core/load3d/Load3d.ts b/src/extensions/core/load3d/Load3d.ts index e010e05c1..89fde7d33 100644 --- a/src/extensions/core/load3d/Load3d.ts +++ b/src/extensions/core/load3d/Load3d.ts @@ -72,7 +72,13 @@ class Load3d { this.renderer.setClearColor(0x282828) this.renderer.autoClear = false this.renderer.outputColorSpace = THREE.SRGBColorSpace - this.renderer.domElement.classList.add('flex', '!h-full', '!w-full') + this.renderer.domElement.classList.add( + 'absolute', + 'inset-0', + 'h-full', + 'w-full', + 'outline-none' + ) container.appendChild(this.renderer.domElement) this.eventManager = new EventManager() @@ -609,7 +615,7 @@ class Load3d { } handleResize(): void { - const parentElement = this.renderer?.domElement + const parentElement = this.renderer?.domElement?.parentElement if (!parentElement) { console.warn('Parent element not found')