瀏覽代碼

fix: hide sidebar when `custom` tool active (#5179)

David Luzar 3 年之前
父節點
當前提交
2537b225ac
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/element/showSelectedShapeActions.ts

+ 4 - 3
src/element/showSelectedShapeActions.ts

@@ -7,9 +7,10 @@ export const showSelectedShapeActions = (
   elements: readonly NonDeletedExcalidrawElement[],
 ) =>
   Boolean(
-    !appState.viewModeEnabled &&
+    (!appState.viewModeEnabled &&
+      appState.activeTool.type !== "custom" &&
       (appState.editingElement ||
-        getSelectedElements(elements, appState).length ||
         (appState.activeTool.type !== "selection" &&
-          appState.activeTool.type !== "eraser")),
+          appState.activeTool.type !== "eraser"))) ||
+      getSelectedElements(elements, appState).length,
   );