Skip to content

Scroll position locked in Firefox #13

@compulim

Description

@compulim

Investigation

After the user do scrolling gesture (e.g. dragging scroll handler up), browsers will do two things:

  1. Set scrollTop to a new value
  2. Fire scroll event

In Firefox, it do 1 and 2 asynchronously. There is a slight chance that our "should we scroll to bottom" check is scheduled to be execute between 1 and 2. If the check is being scheduled untimely, the check will think "yes, I need to scroll, I am not at bottom yet and user didn't scroll me, I didn't see any scroll event."

But in fact, if we wait a bit more time (~20ms), we will see the scroll event emitted from Firefox. And the scroll event indicate user-initiated scrolling, which will release the stickiness, until the user scroll to the bottom or hit the scroll to end button.

Implementation

The fix is to wait for additional 34 ms (2 frames in 60 FPS), to see if the scroll event will fire and disable the stickiness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions