fix(uncontrolled-flow): keep internals

This commit is contained in:
moklick
2022-05-28 22:05:08 +02:00
parent dd51bed6ee
commit 403bf71aeb
3 changed files with 3 additions and 3 deletions

View File

@@ -118,7 +118,7 @@ function useDrag({
}
event.on('end', (event) => {
setDragging(false)
setDragging(false);
if (dragItems.current) {
updateNodePositions(dragItems.current, false, false);

View File

@@ -143,6 +143,7 @@ export function handleControlledNodeSelectionChange(nodeChanges: NodeSelectionCh
if (node) {
nodeInternals.set(node.id, {
...node,
[internalsSymbol]: node[internalsSymbol],
selected: change.selected,
});
}

View File

@@ -1,12 +1,11 @@
import { XYPosition, Dimensions } from './utils';
import { NodeHandleBounds, Node } from './nodes';
import { Node } from './nodes';
import { Edge } from './edges';
export type NodeDimensionChange = {
id: string;
type: 'dimensions';
dimensions: Dimensions;
handleBounds?: NodeHandleBounds;
};
export type NodePositionChange = {