Skip to content

Commit

Permalink
fix(editor): fix issue where drag and drop would break after updating…
Browse files Browse the repository at this point in the history
… component

preserve `ref` property when `UPDATE_PROPS` reducer is run so that `dnd` can still find the target element
  • Loading branch information
danielwarke committed Feb 29, 2024
1 parent c71bf13 commit e730db1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/editor-core/src/reducer/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const reducer = (state: any, action: any) => {
return { ...state };
case 'UPDATE_PROPS':
state.components[action.id] = {
...action.props
...action.props,
ref: state.components[action.id].ref
};
return { ...state };
case 'REMOVE_COMPONENT':
Expand Down

0 comments on commit e730db1

Please sign in to comment.