FreeFeed / freefeed-react-client

React-based frontend
https://freefeed.net
MIT License
39 stars 30 forks source link

A page jump on closing the lightbox #1183

Closed wetterkrank closed 3 years ago

wetterkrank commented 4 years ago

Chrome latest/iOS (12.1, 13.5) -- iPhone 7, iPhone SE2, iPhone 8 Plus at lambdatest.com. Doesn't reproduce with Safari and Firefox/iOS, Chrome/Android or Chrome/Windows.

Can be reproduced with freefeed-react-client ran locally; freefeed.net (less reliably, may require 3-4 retries).

Steps to reproduce: see videos https://www.dropbox.com/s/22qkxemrj137k9f/03-08-2020%2018-27-48.mkv?dl=0 https://www.dropbox.com/s/q0jyy8iec8jhp59/IMG_3158.MOV?dl=0

Expected behavior: After opening and closing the lightbox, scroll position remains unchanged.

Actual behavior: Page is scrolled to a seemingly random position.

wetterkrank commented 4 years ago

What I found out so far. If we change the following in returnToOriginal() function in photoswipe.js, this prevents the jump:

- history.back();
+ history.pushState('', document.title,  _windowLoc.pathname + _windowLoc.search );

However, that's still a workaround and a 2nd level dependency, so I'm not sure it will make a proper fix.

davidmz commented 3 years ago

Fixed in #1226