Sfoglia il codice sorgente

fix: portal auto resize

Konstantinos Kaloutas 2 anni fa
parent
commit
7ea26ed490

+ 9 - 0
tldraw/apps/tldraw-logseq/src/lib/shapes/LogseqPortalShape.tsx

@@ -292,6 +292,15 @@ export class LogseqPortalShape extends TLBoxShape<LogseqPortalShapeProps> {
 
     const [loaded, setLoaded] = React.useState(false)
 
+    React.useEffect(() => {
+      if (!this.initialHeightCalculated) {
+        setTimeout(() => {
+          this.onResetBounds()
+          app.persist(true)
+        })
+      }
+    }, [this.initialHeightCalculated])
+
     React.useEffect(() => {
       setTimeout(function () {
         setLoaded(true)