-
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
Update Cover Block background-attachment: fixed iOS bug handling to properly work with iOS 13+ #40087
Update Cover Block background-attachment: fixed iOS bug handling to properly work with iOS 13+ #40087
Conversation
Thanks for working on this @tomasztunik I am not testing this correctly. It looks good on desktop view, but I am still having the problem at the iPad view. |
If you add this custom SCSS/CSS it should work. scss .wp-block-cover-image,
.wp-block-cover {
&.has-parallax {
@supports (-webkit-touch-callout: inherit) {
background-attachment: scroll !important;
}
}
} css @supports (-webkit-touch-callout: inherit) {
.wp-block-cover.has-parallax,
.wp-block-cover-image.has-parallax {
background-attachment: scroll !important;
}
} PS. |
Thank you for the code! Before adding the CSS codeBefore turning on "Fixed background" After turning on "Fixed background" After adding the CSS code to the customizer.(Ignore the placement of the text. I was testing things with the Grid (Change content position) The code works really well! |
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 works really well!
Thank you!
@tellthemachines @talldan @ndiego |
I do not have an iPad, but if we are confident in this fix, lets get it merged and we can consider for Beta 3 |
For the issue here this is the only way to tackle it, it doesn't change the fix itself just changes how we detect the platform which is backwards compatible with older iOS versions. I think as it was around since iOS 13 it would be worth getting it in. |
I cherry picked this change into |
What?
Update
@supports
check disablingbackground-attachment: fixed
for iOS devices to support latest versions of iPadOS and desktop mode.Fixes #17718
Why?
The current solution was disabled when iPad Safari was rendering pages in
desktop mode
. Support for-webkit-overflow-scrolling: touch
was removed in desktop mode in iOS 13 as mentioned in #17718How?
As suggested in #17718 we change the
@supports
check from-webkit-overflow-scrolling: touch
to-webkit-touch-callout: inherit
Testing Instructions
The block should render the same.
Currently, the block in desktop mode would render oversized as it would try to use
backgorund-position: fixed
but the parallax effect would not work.(a smaller image might make the issue more apparent)
Screenshots or screencast