Skip to content

Commit e730db1

Browse files
authored
fix(editor): fix issue where drag and drop would break after updating component
preserve `ref` property when `UPDATE_PROPS` reducer is run so that `dnd` can still find the target element
1 parent c71bf13 commit e730db1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/editor-core/src/reducer/reducer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ const reducer = (state: any, action: any) => {
1919
return { ...state };
2020
case 'UPDATE_PROPS':
2121
state.components[action.id] = {
22-
...action.props
22+
...action.props,
23+
ref: state.components[action.id].ref
2324
};
2425
return { ...state };
2526
case 'REMOVE_COMPONENT':

0 commit comments

Comments
 (0)