fix: made node toolbar not appear when selecting multiple nodes (#7277)

Made toolbar not appear when selecting more than one node
This commit is contained in:
Lucas Oliveira 2025-03-26 13:23:59 -03:00 committed by GitHub
commit 83e53ceac8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -259,8 +259,12 @@ function GenericNode({
return data.node?.description && data.node?.description !== "";
}, [data.node?.description]);
const selectedNodes = useFlowStore((state) =>
state.nodes.filter((node) => node.selected),
);
const memoizedNodeToolbarComponent = useMemo(() => {
return selected ? (
return selected && selectedNodes.length === 1 ? (
<>
<div
className={cn(
@ -341,6 +345,7 @@ function GenericNode({
editNameDescription,
hasChangedNodeDescription,
toggleEditNameDescription,
selectedNodes,
]);
useEffect(() => {