HomePhabricator

TOC: Stable scrolling when a new element is loaded

Description

TOC: Stable scrolling when a new element is loaded

  • Use default count, rather than 1. if only 1 is loaded, the new topic can't go to the top, since there isn't anything to go below). If it doesn't go to the top, it's both bad UX and leads to loading backwards.
  • Change how scroll offset is calculated. Ideally, it would simply adjust by the height of the affixed (or about-to-be-affixed) navigation (so the navigation doesn't sit on top of part of the topic).

    However, this causes it to show and/or trigger the 'load more' above the element. So we try to adjust an arbitrary amount that's enough to get free from the nav, but not too much.

Bug: T78565
Change-Id: I96e3a4b08f7df5f4600a4d7f7367349fee50c34a