Skip to content

[BUG] useScroll scrollYProgress doesn't update when page height changes #2274

@IDrumsey

Description

@IDrumsey

I have embedded content getting loaded on the page and a horizontal progress bar like seen in the official docs. After the embedded content loads, the scrollYProgress does not update. It only updates once you scroll again.

https://codesandbox.io/s/framer-motion-usescroll-forked-t8dvzr?file=/src/App.tsx

Steps to reproduce

  1. reload the sandbox viewer and then immediately scroll to the bottom and stop scrolling. You have a 3 second window, but you can change that if needed.

Notice how once the extra content is loaded the progress bar is still at 100% width

5. Expected behavior

If the page height changes, the scrollYProgress should automatically update. Shouldn't have to wait for more scrolling.

Using framer-motion 10.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions