Page MenuHomePhabricator

Differential "stick to the comment area" and "jump to anchor" scroll behaviors interact destructively while loading content
Closed, ResolvedPublic

Description

To reproduce, follow the link to https://secure.phabricator.com/D16655#196360 or D16655#196360 (I got the link by clicking on the date of the comment)

The browser seems to scroll to the highlighted comment but then continues to scroll and ends up somewhere else.
I would expect it to just show the selected comment.

Tested with firefox 45 and chromium 53

(The issue is with all differentials, also on my install. D16655 is the first one I could find with a comment)

Event Timeline

I don't believe this is possible to fix without significant performance penalties for everyone else, given content is ajaxed in.

I think this is actually a bug between several of the 300 different pieces of scroll magic we have on the page.

We have one piece of scroll magic which tries to keep your browser scrolled to the bottom if it looks like you're trying to write a comment, so the page doesn't jump around while content loads.

We detect "you're trying to write a comment" by seeing if you've scrolled near the bottom of the page, roughly.

When you visit D16655#196360, the browser scrolls to the anchor. Since the diff content hasn't loaded yet, the anchor is close enough to the bottom of the page (if your browser window is fairly tall) that it triggers the "stick to the bottom" scroll behavior. As the content loads, we then stick to the bottom while rendering it.

You can get the correct behavior by following the link in a very short browser window, so that the anchor isn't close enough to the bottom of the page to trigger the sticky scroll.

We can do a few things to refine this, although I don't have a completely unambiguous fix offhand.

epriestley renamed this task from direct links to differential comments are not scrolling to the comment to Differential "stick to the comment area" and "jump to anchor" scroll behaviors interact destructively while loading content.Oct 25 2016, 3:50 PM
epriestley triaged this task as Low priority.
epriestley added a project: Differential.