Skip to content

Commit

Permalink
Address feedback and attempt to fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 9, 2021
1 parent 855a9ce commit 2a39dc3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
5 changes: 4 additions & 1 deletion lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
1
);

// Ideally styles should be loaded in the head, but blocks may be parsed
// after that, so loading in the footer for now.
// See https://core.trac.wordpress.org/ticket/53494.
add_action(
'wp_head',
'wp_footer',
function () use ( $style ) {
echo '<style>' . $style . '</style>';
}
Expand Down
17 changes: 9 additions & 8 deletions packages/block-editor/src/hooks/duotone.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,15 @@ const withDuotoneStyles = createHigherOrderComponent(

return (
<>
{ createPortal(
<DuotoneFilter
selector={ selectorsGroup }
id={ id }
values={ getValuesFromColors( values ) }
/>,
element
) }
{ element &&
createPortal(
<DuotoneFilter
selector={ selectorsGroup }
id={ id }
values={ getValuesFromColors( values ) }
/>,
element
) }
<BlockListBlock { ...props } className={ className } />
</>
);
Expand Down
15 changes: 8 additions & 7 deletions packages/block-editor/src/hooks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,14 @@ export const withLayoutStyles = createHigherOrderComponent(

return (
<>
{ createPortal(
<LayoutStyle
selector={ `.wp-container-${ id }` }
layout={ usedLayout }
/>,
element
) }
{ element &&
createPortal(
<LayoutStyle
selector={ `.wp-container-${ id }` }
layout={ usedLayout }
/>,
element
) }
<BlockListBlock { ...props } className={ className } />
</>
);
Expand Down

0 comments on commit 2a39dc3

Please sign in to comment.