Skip to content

Commit

Permalink
Add selector as id to layout style overrides. (#55291)
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines authored Oct 12, 2023
1 parent 27d7cf8 commit 90007e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/block-editor/src/hooks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,11 @@ export const withLayoutStyles = createHigherOrderComponent(

useEffect( () => {
if ( ! css ) return;
setStyleOverride( id, { css } );
setStyleOverride( selector, { css } );
return () => {
deleteStyleOverride( id );
deleteStyleOverride( selector );
};
}, [ id, css, setStyleOverride, deleteStyleOverride ] );
}, [ selector, css, setStyleOverride, deleteStyleOverride ] );

return (
<BlockListBlock
Expand Down Expand Up @@ -472,11 +472,11 @@ export const withChildLayoutStyles = createHigherOrderComponent(

useEffect( () => {
if ( ! css ) return;
setStyleOverride( id, { css } );
setStyleOverride( selector, { css } );
return () => {
deleteStyleOverride( id );
deleteStyleOverride( selector );
};
}, [ id, css, setStyleOverride, deleteStyleOverride ] );
}, [ selector, css, setStyleOverride, deleteStyleOverride ] );

return <BlockListBlock { ...props } className={ className } />;
},
Expand Down

1 comment on commit 90007e3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 90007e3.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6501669256
📝 Reported issues:

Please sign in to comment.