Skip to content

Editor inline styles generated by block supports are broken in Query Loop block preview #54956

Closed
@fabiankaegy

Description

Description

When using a Query Loop to display content, all but the currently selected items in the query get rendered using the __experimentalUseBlockPreview hook.

In WordPress 6.4 Beta 1 this block preview does not get any of the blocks generated inline styles from the style engine applied causing broken layouts in the editor.

The items rendered by the useBlockPreview hook are missing the generated classnames wp-container-278

Step-by-step reproduction instructions

  1. Insert a Query Loop Block
  2. Insert a "Stack" block within the Post Template
  3. Set the layout of the Stack block to centered
  4. Change the block gap value of the stack block
  5. Select a different item in the query loop
  6. you will see the layout being broken for the non selected items

Screenshots, screen recording, code snippet

CleanShot.2023-10-01.at.17.19.18.mp4

Environment info

  • WordPress 6.4 Beta 1
  • Twenty Twenty Four Theme
  • No Gutenberg Plugin active

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Assignees

Labels

[Block] Post TemplateAffects the Post Template Block[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Feature] UI ComponentsImpacts or related to the UI component system[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions