Skip to content

[BUG] scroll()/useScroll report elastic overscroll as forward scroll #3791

Description

@ohgree

2. Describe the bug

During elastic overscroll at the top of the page (Safari's rubber-band, macOS and iOS), window.scrollY goes negative but useScroll().scrollY / info.y.current report the unsigned magnitude, so a 25px pull reads as 25px of forward scroll. Cause: the unconditional Math.abs in updateAxisInfo (added in abaf16e for #3340's reverse-direction containers) also folds the sign of transient overscroll in normal containers.

3. CodeSandbox reproduction

https://codesandbox.io/p/sandbox/3dmxgc

4. Steps to reproduce

  1. Open the sandbox preview in Safari, scrolled to the top.
  2. Pull up so the page rubber-bands.
  3. The readout shows window.scrollY negative while info.y.current reports it positive.

5. Expected behavior

Normal containers keep the signed offset, matching window.scrollY; reverse-direction containers keep the normalized values from #3340; progress stays within [0, 1].

6. Video or screenshots

Screen.Recording.2026-08-14.at.1.54.36.PM.mov

Covered by the sandbox readout.

7. Environment details

motion 12.43.0, also present on current main. Reproduced in Safari on macOS.

Fix branch linked in the comment below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions