-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Cover Block: flickering in site editor page view when used within a synced pattern #53211
Copy link
Copy link
Labels
[Block] CoverAffects the Cover Block - used to display content laid over a background imageAffects the Cover Block - used to display content laid over a background image[Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsyncedA collection of blocks that can be synced (previously reusable blocks) or unsynced[Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")Related to the overarching Site Editor (formerly "full site editing")[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Metadata
Metadata
Assignees
Labels
[Block] CoverAffects the Cover Block - used to display content laid over a background imageAffects the Cover Block - used to display content laid over a background image[Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsyncedA collection of blocks that can be synced (previously reusable blocks) or unsynced[Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")Related to the overarching Site Editor (formerly "full site editing")[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
useCoverIsDarkwithin 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
templatesdirectory).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.htmlfilemy-template.html.Example markup from my
my-template.htmlfile: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