Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(zbugs): Manually control scrolling when comments change (#3398)
There are 3 cases we care about (in order of priority): 1. When we are near the top and the issue description is in the viewport we do not need to manipulate the scroll position. 2. When we are near the end of the page (currently hardcoded to 175px because that is the size of the new comment input and button) we maintain the scrollBottom (there is no such property but we compute it). 3. Otherwise use the first (partial) comment in the viewport as the anchor and we remember its distance to the top edge. When we restore the scroll position we keep the same distance. We find the best anchor point during scroll. And we restore/fix the scroll position when comments change.
- Loading branch information