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

Page scrolls to top after closing lightbox (mobile only) #485

Open
K-Jayk opened this issue Apr 26, 2024 · 1 comment
Open

Page scrolls to top after closing lightbox (mobile only) #485

K-Jayk opened this issue Apr 26, 2024 · 1 comment

Comments

@K-Jayk
Copy link

K-Jayk commented Apr 26, 2024

Describe the bug
I am working on a wordpress website, built in Oxygen builder. (Using these instructions: https://oxygen4fun.supadezign.com/tutorials/how-to-add-a-lightbox-effect-to-your-images/). The lightbox works beautifully on desktop.

Unfortunately, on mobile, whenever a lightbox is opened, the page reset to the top. So the user is forced to re-scroll all the way back to where they were previously. I noticed that the scroll-reset seems to happen as/before the lightbox even loads.

I'd like for the browser to to be on the same place when the user closes the lightbox.

So far I've seen this on iPhone Pro 13, Sony Xperia II, Samsung Galaxy.

I noticed a similar problem posted from 2018, but it was marked as resolved, so I assumed that downloading the latest version of the code would work, but it doesn't seem to be the case...

@gingerchew
Copy link
Collaborator

gingerchew commented May 25, 2024

Hmmmm, that sounds out of our (and your) control. GLightbox docs recommend (and is built around) using <a> tags, but you could use the provided API to use buttons instead. My thought is that the browser sees the user click on a link, can't go to the href, and so instead goes to the default behavior (scroll to top in this case). Buttons don't have any scroll behavior intended in their purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants