Files
NetNewsWire/iOS/Article
Dave Marquard fc2a39f5ff Keep the reader's place in an article across a rotation
The recorded scroll position is window.scrollY, an absolute pixel offset
baked into the rendered page. Rotating reflows the article at a new width,
so that offset points somewhere else. The web view also scrolls on its own
during the transition, overwriting the stored position before anything can
restore it.

Record the element at the top of the viewport along with its offset, stop
recording while the view changes size, and scroll back to that element once
the transition ends.

Verified on an iPhone Duo. The same loss happens on iPad, which is where I
first noticed it.

Written with help from Claude Code.
2026-11-03 14:02:00 -08:00
..