From 8b1bf1f6587c6d279c4d59efd0674a1f6d8964fe Mon Sep 17 00:00:00 2001 From: Berci Kormendy Date: Tue, 22 Oct 2024 12:42:17 +0200 Subject: [PATCH] only zero some props --- editor/src/components/canvas/plugins/style-plugins.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/editor/src/components/canvas/plugins/style-plugins.ts b/editor/src/components/canvas/plugins/style-plugins.ts index 00ae35ee6c6f..088820abb348 100644 --- a/editor/src/components/canvas/plugins/style-plugins.ts +++ b/editor/src/components/canvas/plugins/style-plugins.ts @@ -49,12 +49,11 @@ export function runStyleUpdateMidInteraction( updates: StyleUpdate[], ) { const withRemovedPropsPatched = updates.map((p): StyleUpdate => { - switch (p.type) { - case 'set': - return p - case 'delete': - return { type: 'set', property: p.property, value: PropertyPatchValues[p.property] } + if (p.type === 'delete' && PropertyPatchValues[p.property] != null) { + return { type: 'set', property: p.property, value: PropertyPatchValues[p.property] } } + + return p }) return InlineStylePlugin.updateStyles(editorState, elementPath, withRemovedPropsPatched) }