-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix repeated backgrounds for cover srcset #28310
Conversation
@@ -152,7 +159,7 @@ const deprecated = [ | |||
); | |||
|
|||
return ( | |||
<div className={ classes } style={ style }> | |||
<div { ...useBlockProps.save( { className: classes, style } ) }> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this from the save
function prior to the srcset change. The useBlockProps
must have been added in addition to the isRepeated
before the srcset change was merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good and in testing I didn't find any issues.
👍
So I'm just a little late to the party. I'd just captured a screen recording to post here when I saw it'd been merged. I would have recorded/posted earlier as I had tested this yesterday but I assumed what I saw was going to be caught by others. Maybe I'm the only one seeing this but in my testing, this didn't appear ready. The repeated background is showing but also layered with the same image in the cover-srcset-repeated.mp4It'd be great if there's just something going on with my setup and this is not reproducible. |
@stokesman I must not have noticed because I had a large image without any transparency. I added a fix in #28362 |
Description
See #25171 (comment). Thanks @stokesman for reporting the bug.
This just adds a check for
isRepeated
in addition tohasParallax
for using background styles.How has this been tested?
Use the repeated background in the cover block. See that it still works.
Checkout cfe936a (commit before Add srcset for cover image #25171). Add the old block to a post and save the post. Checkout this branch. Re-open the post. See that the deprecated block gets upgraded.
Screenshots
Types of changes
Bug Fix
Checklist: