Cover Block: flickering in site editor page view when used within a synced pattern #53211
Labels
[Block] Cover
Affects the Cover Block - used to display content laid over a background image
[Feature] Patterns
A collection of blocks that can be synced (previously reusable blocks) or unsynced
[Feature] Site Editor
Related to the overarching Site Editor (formerly "full site editing")
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
While reviewing #53169 an issue with the Cover block was encountered, where sometimes it will repeatedly flicker when displayed within the site editor's view of an individual page, when the Cover block is contained within a synced pattern that forms part of the template.
The flickering appears to be to do with logic in
useCoverIsDark
within the Cover block. Specifically, the async state update in:gutenberg/packages/block-library/src/cover/edit/use-cover-is-dark.js
Lines 43 to 53 in ba31d2d
Kudos @aaronrobertshaw for finding the bug and the lines of code relevant for it!
Step-by-step reproduction instructions
templates
directory).my-template.html
, add the synced block pattern. To get the markup to add to the template, you can add the synced pattern to a post or page, then view the code editor view and copy + paste to yourmy-template.html
filemy-template.html
.Example markup from my
my-template.html
file:Screenshots, screen recording, code snippet
2023-08-01.11.44.52.mp4
Environment info
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
The text was updated successfully, but these errors were encountered: