浏览代码

fix: hide context bar on context menu

Konstantinos Kaloutas 3 年之前
父节点
当前提交
1b6d8b054f

+ 4 - 1
tldraw/apps/tldraw-logseq/src/components/ContextBar/ContextBar.tsx

@@ -43,7 +43,10 @@ const _ContextBar: TLContextBarComponent<Shape> = ({ shapes, offsets, hidden })
         <div
           ref={rContextBar}
           className="tl-contextbar"
-          style={{ pointerEvents: hidden ? 'none' : 'all' }}
+          style={{
+            visibility: hidden ? 'hidden' : 'visible',
+            pointerEvents: hidden ? 'none' : 'all'
+          }}
         >
           {Actions.map((Action, idx) => (
             <React.Fragment key={idx}>

+ 1 - 0
tldraw/packages/core/src/lib/TLApp/TLApp.ts

@@ -708,6 +708,7 @@ export class TLApp<
     return (
       !ctrlKey &&
       this.isInAny('select.idle', 'select.hoveringSelectionHandle') &&
+      !this.isIn('select.contextMenu') &&
       selectedShapesArray.length > 0 &&
       !selectedShapesArray.every(shape => shape.hideContextBar)
     )

+ 0 - 4
tldraw/packages/react/src/components/ContextBarContainer/ContextBarContainer.tsx

@@ -52,10 +52,6 @@ export const ContextBarContainer = observer(function ContextBarContainer<S exten
     height: screenBounds.height,
   }
 
-  const inView =
-    BoundsUtils.boundsContain(vpBounds, screenBounds) ||
-    BoundsUtils.boundsCollide(vpBounds, screenBounds)
-
   return (
     <div
       ref={rBounds}