Browse Source

fix: youtube shape ux

Peng Xiao 3 years ago
parent
commit
f6bc4aa73c
1 changed files with 3 additions and 3 deletions
  1. 3 3
      tldraw/apps/tldraw-logseq/src/lib/shapes/YouTubeShape.tsx

+ 3 - 3
tldraw/apps/tldraw-logseq/src/lib/shapes/YouTubeShape.tsx

@@ -43,7 +43,7 @@ export class YouTubeShape extends TLBoxShape<YouTubeShapeProps> {
     this.update({ url, size: YouTubeShape.defaultProps.size })
   }
 
-  ReactComponent = observer(({ events, isErasing, isEditing }: TLComponentProps) => {
+  ReactComponent = observer(({ events, isErasing, isEditing, isSelected }: TLComponentProps) => {
     return (
       <HTMLContainer
         style={{
@@ -56,7 +56,7 @@ export class YouTubeShape extends TLBoxShape<YouTubeShapeProps> {
         <div
           className="rounded-lg w-full h-full relative overflow-hidden shadow-xl"
           style={{
-            pointerEvents: isEditing ? 'all' : 'none',
+            pointerEvents: (isEditing || isSelected) ? 'all' : 'none',
             userSelect: 'none',
           }}
         >
@@ -120,7 +120,7 @@ export class YouTubeShape extends TLBoxShape<YouTubeShapeProps> {
         size: [w, h],
       },
     } = this
-    return <rect width={w} height={h} fill="transparent" />
+    return <rect width={w} height={h} fill="transparent" stroke="none" />
   })
 
   validateProps = (props: Partial<YouTubeShapeProps>) => {