Skip to content
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

Cover Block: Fixed Background Does Not Work on Mobile #50669

Open
karenroldan opened this issue May 16, 2023 · 6 comments
Open

Cover Block: Fixed Background Does Not Work on Mobile #50669

karenroldan opened this issue May 16, 2023 · 6 comments
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image Browser Issues Issues or PRs that are related to browser specific problems OS Issues Issues or PRs that are related to OS specific problems [Status] Blocked Used to indicate that a current effort isn't able to move forward [Type] Bug An existing feature does not function as intended

Comments

@karenroldan
Copy link

karenroldan commented May 16, 2023

Description

Originally reported in Automattic/wp-calypso#76885

Quick summary

When the fixed background option of the cover block is enabled, it works on all platforms except mobile Safari.
It might be related to this previous issue: Automattic/wp-calypso#57390

Steps to reproduce

  1. Open or create a template in the Site Editor.
  2. Add a Cover block.
  3. Set a background image.
  4. Set the background as fixed.
  5. Visit the site using mobile and scroll down.
  6. What you expected to happen
  7. The background should be fixed, showing a parallax effect.

What actually happened

The background moves with the rest of the page.

Impact

All

Logs or notes

Summary

Step-by-step reproduction instructions

  1. Open or create a template in the Site Editor.
  2. Add a Cover block.
  3. Set a background image.
  4. Set the background as fixed.
  5. Visit the site using mobile and scroll down.
  6. What you expected to happen
  7. The background should be fixed, showing a parallax effect.

Screenshots, screen recording, code snippet

Mobile

mobile.mov

Desktop

desktop

Environment info

  • Gutenberg: v15.7.1
  • Tested on the actual device: Chrome and Safari and the issue is reproducible
  • iPhone with iOS 16.4.1

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

@karenroldan karenroldan added [Block] Cover Affects the Cover Block - used to display content laid over a background image [Type] Bug An existing feature does not function as intended labels May 16, 2023
@draganescu draganescu added the Browser Issues Issues or PRs that are related to browser specific problems label May 17, 2023
@robinglen
Copy link

@draganescu I asked here (Automattic/wp-calypso#76885) but to complete the loop is there any update here?

@draganescu
Copy link
Contributor

Hi there! This issue does not appear to be worked on yet. Are you planning to try a PR - I think I inferred that from the other issue?

@robinglen
Copy link

Hi @draganescu thank you for getting back to me.

We are waiting to see if our client is interested in us submitting a PR or wants us to build our own new component in their thee. However for transparency and anyone else looking into this ticket, from our research and the other ticket, here are some findings:

The main issue is because Apple have decided to not support background-attachment; on iOS for iPhone and iPad, we believe this is because of performance issues caused by this attribute.
https://developer.apple.com/forums/thread/99883

The required behaviour is not impossible as you can see it on this codepen: https://codepen.io/Everybodyknows/pen/abbyLOZ

However the build of this codepen is a completely different structure to the Guttenberg component in question. There are a couple of ways we could create this behaviour that works across those platforms.

  1. The surrounding components having solid backgrounds (which isn't currently the case on our project - the parallax images basically always sit behind the content in this solution, so anything at all without a background would show the image)
  2. Each parallax component getting subsequently bigger z-indexes, i.e first one needs a z-index:1, second needs z-index:2 etc

So we think there is no simple CSS hack to trick we can do to fix the existing component, if we want to solve this we believe the component will need to be built in a different way.

For now we are waiting to hear from our client, personally based on the effort involved to fix it vs customer impact we don't think it will go ahead however if it does I will let you know.

@draganescu draganescu added [Status] Blocked Used to indicate that a current effort isn't able to move forward OS Issues Issues or PRs that are related to OS specific problems labels Nov 2, 2023
@draganescu
Copy link
Contributor

Thanks for the awesome in depth description @robinglen 🙇🏻 I added the blocked label since I think this can be fixed only when the rule will become supported.

@Robertght
Copy link

Robertght commented Oct 9, 2024

@draganescu I've also linked this report Automattic/wp-calypso#95234, but aside from the fixed background that's not working, we also seem to experience a Zoomed-in view. A bit of a 2 in 1 issue. I reported the Zoom separately here first but decided to close it in favor of the one above.

Is there a way to better organize these?

@draganescu
Copy link
Contributor

@Robertght I don't think there is a better way. I would not keep duplicate issues anywhere and if they're 100% caused by the same problem (the zoom and the blank) then just keep one, augment the content and close the other.

I wonder if we should try maybe a color fix or something...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image Browser Issues Issues or PRs that are related to browser specific problems OS Issues Issues or PRs that are related to OS specific problems [Status] Blocked Used to indicate that a current effort isn't able to move forward [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants