diff --git a/editor/src/components/canvas/canvas-strategies/canvas-strategies.tsx b/editor/src/components/canvas/canvas-strategies/canvas-strategies.tsx index c14f07eb91c0..de94635acca2 100644 --- a/editor/src/components/canvas/canvas-strategies/canvas-strategies.tsx +++ b/editor/src/components/canvas/canvas-strategies/canvas-strategies.tsx @@ -83,7 +83,7 @@ import { reparentSubjectsForInteractionTarget } from './strategies/reparent-help import { getReparentTargetUnified } from './strategies/reparent-helpers/reparent-strategy-parent-lookup' import { gridRearrangeResizeKeyboardStrategy } from './strategies/grid-rearrange-keyboard-strategy' import createCachedSelector from 're-reselect' -import { getActivePlugin } from '../plugins/style-plugins' +import { getActivePlugin, patchRemovedProperties } from '../plugins/style-plugins' import { controlsForGridPlaceholders, GridControls, @@ -495,6 +495,16 @@ export function applyCanvasStrategy( return strategy.apply(strategyLifecycle) } +export function applyElementsToRerenderFromStrategyResultAndZeroProps( + editorState: EditorState, + strategyResult: StrategyApplicationResult, +): EditorState { + return applyElementsToRerenderFromStrategyResult( + patchRemovedProperties(editorState), + strategyResult, + ) +} + export function applyElementsToRerenderFromStrategyResult( editorState: EditorState, strategyResult: StrategyApplicationResult, diff --git a/editor/src/components/editor/store/dispatch-strategies.tsx b/editor/src/components/editor/store/dispatch-strategies.tsx index 0ea061bdc737..43d9f266192f 100644 --- a/editor/src/components/editor/store/dispatch-strategies.tsx +++ b/editor/src/components/editor/store/dispatch-strategies.tsx @@ -6,6 +6,7 @@ import type { import { applyCanvasStrategy, applyElementsToRerenderFromStrategyResult, + applyElementsToRerenderFromStrategyResultAndZeroProps, findCanvasStrategy, interactionInProgress, pickCanvasStateFromEditorState, @@ -222,7 +223,7 @@ export function interactionHardReset( return { unpatchedEditorState: newEditorState, - patchedEditorState: applyElementsToRerenderFromStrategyResult( + patchedEditorState: applyElementsToRerenderFromStrategyResultAndZeroProps( commandResult.editorState, strategyResult, ), @@ -390,7 +391,7 @@ export function interactionStart( return { unpatchedEditorState: newEditorState, - patchedEditorState: applyElementsToRerenderFromStrategyResult( + patchedEditorState: applyElementsToRerenderFromStrategyResultAndZeroProps( commandResult.editorState, strategyResult, ), @@ -497,7 +498,7 @@ function handleUserChangedStrategy( return { unpatchedEditorState: newEditorState, - patchedEditorState: applyElementsToRerenderFromStrategyResult( + patchedEditorState: applyElementsToRerenderFromStrategyResultAndZeroProps( commandResult.editorState, strategyResult, ), @@ -583,7 +584,7 @@ function handleAccumulatingKeypresses( return { unpatchedEditorState: updatedEditorState, - patchedEditorState: applyElementsToRerenderFromStrategyResult( + patchedEditorState: applyElementsToRerenderFromStrategyResultAndZeroProps( commandResult.editorState, strategyResult, ), @@ -650,7 +651,7 @@ function handleUpdate( } return { unpatchedEditorState: newEditorState, - patchedEditorState: applyElementsToRerenderFromStrategyResult( + patchedEditorState: applyElementsToRerenderFromStrategyResultAndZeroProps( commandResult.editorState, strategyResult, ), diff --git a/editor/src/components/editor/store/dispatch.tsx b/editor/src/components/editor/store/dispatch.tsx index ca8f9af9c4ad..95195af7c341 100644 --- a/editor/src/components/editor/store/dispatch.tsx +++ b/editor/src/components/editor/store/dispatch.tsx @@ -1013,14 +1013,9 @@ function editorDispatchInner( storedState.patchedDerived, ) - const unpatchedEditor = patchRemovedProperties(unpatchedEditorStateFromStrategies) - const patchedEditor = patchRemovedProperties(patchedEditorStateFromStrategies) - - resetUpdatedPropertiesGlobal() - return { - unpatchedEditor: unpatchedEditor, - patchedEditor: patchedEditor, + unpatchedEditor: unpatchedEditorStateFromStrategies, + patchedEditor: patchedEditorStateFromStrategies, unpatchedDerived: frozenDerivedState, patchedDerived: patchedDerivedState, strategyState: newStrategyState,