Przeglądaj źródła

fix: html shape issues

Peng Xiao 3 lat temu
rodzic
commit
7ea559894f

+ 1 - 6
tldraw/apps/tldraw-logseq/src/lib/shapes/HTMLShape.tsx

@@ -79,19 +79,14 @@ export class HTMLShape extends TLBoxShape<HTMLShapeProps> {
           onPointerUp={stop}
           className="tl-html-container"
           style={{
-            width: '100%',
-            height: '100%',
             pointerEvents: isEditing ? 'all' : 'none',
-            userSelect: 'all',
-            position: 'relative',
-            margin: 0,
             overflow: isEditing ? 'auto' : 'hidden',
           }}
         >
           <div
             ref={anchorRef}
             className="tl-html-anchor"
-            dangerouslySetInnerHTML={{ __html: html }}
+            dangerouslySetInnerHTML={{ __html: html.trim() }}
           />
         </div>
       </HTMLContainer>

+ 8 - 3
tldraw/apps/tldraw-logseq/src/styles.css

@@ -580,9 +580,14 @@
   flex-grow: 0;
 }
 
-.tl-html-container > iframe {
-  @apply h-full w-full !important;
-  margin: 0;
+.tl-html-container {
+  @apply h-full w-full m-0 relative flex;
+  user-select: text;
+
+  > iframe {
+    @apply h-full w-full !important;
+    margin: 0;
+  }
 }
 
 .tl-logseq-cp-container {