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

iOS - the page is being scrolled in background for tall modals #1956

Open
limonte opened this issue May 8, 2020 · 9 comments
Open

iOS - the page is being scrolled in background for tall modals #1956

limonte opened this issue May 8, 2020 · 9 comments
Labels
help wanted Extra attention is needed platform: iOS

Comments

@limonte
Copy link
Member

limonte commented May 8, 2020

If you watch this video you will see after scrolling to the bottom the content in the background can be scrolled. Look at the top right hand corner for the darker scroll bar to move.

Originally posted by @wilecoyte78 in #1948 (comment)

@limonte limonte added platform: iOS help wanted Extra attention is needed labels May 8, 2020
@limonte
Copy link
Member Author

limonte commented May 31, 2020

I was able to reproduce this, but only a couple of times and it seems that it happens randomly. I can't come up with the steps to reproduce.

@brunoinds
Copy link

This problem is so antique, it almost like unsolvable using pure JavaScript code and CSS. I think the problem you're experimenting with is the "iOS Safari Scrolling Issue". Sometimes the scroll freezes, sometimes it only scrolls the body element, like it attaches the highest DOM node, not the event.target itself. I've already found a lot of "solutions" in forums, but, never in all cases where this problem should appear. The best way to correct it is to mix every soloution in Stackoverflow about the Safari Scrolling Issue (using JS, CSS fixed property, and frameworks specialized on it) and wish it resolves your problem. I think WebKit doesn't care about it. This problem exists about 8 years and nothing. You know, Apple being Apple with Web Developers.

@Jadhielv
Copy link
Contributor

Jadhielv commented Oct 4, 2020

Hey! @limonte trying to reproduce this a four of times or more (iOS 14.2 beta) randomly in some browsers: Safari, Firefox and Chrome. I don't see any unexpected behavior, always scrolling is OK.

@Jadhielv
Copy link
Contributor

Jadhielv commented Nov 8, 2020

Check this too @limonte

@limonte
Copy link
Member Author

limonte commented Nov 8, 2020

Still reproducible (iOS 14.2) here: https://sweetalert2.github.io/

Reproducible if you try to scroll right after triggering the modal:

@Jadhielv
Copy link
Contributor

Jadhielv commented Jul 13, 2021

iOS 14.6 (18F72)

NOTE: ¿Will it be OK in this version? @limonte

@limonte
Copy link
Member Author

limonte commented Sep 29, 2021

The issue is still happening in iOS 15.

@Jadhielv
Copy link
Contributor

@limonte thanks for the update.

goestav added a commit to goestav/sweetalert2 that referenced this issue Oct 11, 2022
This commit fixes a bug where you could scroll the background (page) when you reached the end of the alert.
@markusramsak
Copy link

markusramsak commented Nov 26, 2022

I solved this issue for my own dialog plugin by using the following steps:

  • wrapping the body content in a different container than the dialog container
  • when opening the dialog container -> the body content container is hidden (on iOS you don't see what is behind anyway)
  • after closing dialog -> everthing is restored (even the scroll position - because I saved it before opening the dialog)

This solutions works for me on my iPhone the last two years without any issues. And I only do this fix on mobile where this issue exists.

I hope it helps you fix it for iOS forever ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed platform: iOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants