Skip to content

Commit

Permalink
only zero some props
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrmendy committed Oct 22, 2024
1 parent c738164 commit 8b1bf1f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions editor/src/components/canvas/plugins/style-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 8b1bf1f

Please sign in to comment.