[READ-ONLY] Mirror of https://github.com/improsocial/impro An extensible Bluesky client for web impro.social

Restore scroll position correctly after a scroll lock on iOS

Closing the lightbox on iOS could jump the page far from where the user was. lockScroll() read main's bounding rect right after pinning the body, and iOS WebKit can still report that rect against the pre-lock scroll offset. unlockScroll() then added that stale offset to the restored position, scrolling past the original spot by roughly the scroll distance (a 3600px position restored as 7200px in the new test). Measure main only at unlock instead: read its on-screen top while still locked, release the body, then scroll so main lands at that same on-screen position. This still follows main when it moved while locked, and keeps it in place when content above it changed. Co-Authored-By: Claude <noreply@anthropic.com>


Author Joshua Shew Co-author Claude Date Commit Parent 890e2d68
+45 -7
2 changed files
+45 -7
2 changed files