Skip to content

开源白板工具(SaaS),一体化白板,包含思维导图、流程图、自由画等。All in one open-source whiteboard tool with mind, flowchart, freehand and etc.

feat(image): should hide popup toolbar when selected element include image (#96)

pubuzhixing85a9eb09fdbb4
diff --git a/packages/drawnix/src/components/toolbar/popup-toolbar/popup-toolbar.tsx b/packages/drawnix/src/components/toolbar/popup-toolbar/popup-toolbar.tsx
index 7866062..ad73b15 100644
--- a/packages/drawnix/src/components/toolbar/popup-toolbar/popup-toolbar.tsx
+++ b/packages/drawnix/src/components/toolbar/popup-toolbar/popup-toolbar.tsx
@@ -44,7 +44,10 @@ export const PopupToolbar = () => {
const selectedElements = getSelectedElements(board);
const [movingOrDragging, setMovingOrDragging] = useState(false);
const movingOrDraggingRef = useRef(movingOrDragging);
- const open = selectedElements.length > 0 && !isSelectionMoving(board);
+ const open =
+ selectedElements.length > 0 &&
+ !isSelectionMoving(board) &&
+ !selectedElements.some(PlaitDrawElement.isImage);
const { viewport, selection, children } = board;
const { refs, floatingStyles } = useFloating({
placement: 'right-start',