Skip to content

Commit

Permalink
Do not run property patching when the inline style plugin is active (#…
Browse files Browse the repository at this point in the history
…6635)

## Problem

https://github.com/concrete-utopia/utopia/blob/9e34bde077fbb324e4bb2fcbf9ffc067e680aa60/editor/src/components/canvas/plugins/style-plugins.ts#L180

Since `StyleInfo` only supports a subset of the style props that the
editor updates/deletes, this error is triggered many times during normal
editor use. When the inline style plugin is active (which is always the
case when the Tailwind feature flag isn't expressly turned on), this
error isn't signalling an actual error, since removed properties don't
have to be zeroed when the project only uses inline styles.

## Fix
Do not run the zeroing code if the inline style plugin is active, since
it's not actually needed in that case

### Manual Tests
I hereby swear that:

- [x] I opened a hydrogen project and it loaded
- [x] I could navigate to various routes in Play mode
  • Loading branch information
bkrmendy authored and liady committed Dec 13, 2024
1 parent a8e2a30 commit 73db22b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion editor/src/components/canvas/plugins/style-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ function getPropertiesToZero(
}

export function patchRemovedProperties(editorState: EditorState): EditorState {
const styleInfoReader = getActivePlugin(editorState).styleInfoFactory({
const activePlugin = getActivePlugin(editorState)
if (activePlugin.name === InlineStylePlugin.name) {
return editorState
}

const styleInfoReader = activePlugin.styleInfoFactory({
projectContents: editorState.projectContents,
})

Expand Down

0 comments on commit 73db22b

Please sign in to comment.