Skip to content

Commit 08faa69

Browse files
authored
fix: 3d resize vertically (#7621)
## 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)
1 parent 08a3c76 commit 08faa69

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/extensions/core/load3d/Load3d.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ class Load3d {
7272
this.renderer.setClearColor(0x282828)
7373
this.renderer.autoClear = false
7474
this.renderer.outputColorSpace = THREE.SRGBColorSpace
75-
this.renderer.domElement.classList.add('flex', '!h-full', '!w-full')
75+
this.renderer.domElement.classList.add(
76+
'absolute',
77+
'inset-0',
78+
'h-full',
79+
'w-full',
80+
'outline-none'
81+
)
7682
container.appendChild(this.renderer.domElement)
7783

7884
this.eventManager = new EventManager()
@@ -609,7 +615,7 @@ class Load3d {
609615
}
610616

611617
handleResize(): void {
612-
const parentElement = this.renderer?.domElement
618+
const parentElement = this.renderer?.domElement?.parentElement
613619

614620
if (!parentElement) {
615621
console.warn('Parent element not found')

0 commit comments

Comments
 (0)