fix(node-update): force update when source or target pos changes

This commit is contained in:
moklick
2021-02-23 19:27:45 +01:00
parent 1da1d697b6
commit ebbc192b8d
4 changed files with 19 additions and 10 deletions
+4 -4
View File
@@ -78,12 +78,12 @@ export default function reactFlowReducer(state = initialState, action: ReactFlow
const update = action.payload.find((u) => u.id === node.id);
if (update) {
const dimensions = getDimensions(update.nodeElement);
if (
const doUpdate =
dimensions.width &&
dimensions.height &&
(node.__rf.width !== dimensions.width || node.__rf.height !== dimensions.height)
) {
(node.__rf.width !== dimensions.width || node.__rf.height !== dimensions.height || update.forceUpdate);
if (doUpdate) {
const handleBounds = getHandleBounds(update.nodeElement, state.transform[2]);
return {