Skip to content

@react-spring/parallax fails to position elements when speed is not 0 #1422

@alexcanessa

Description

@alexcanessa

🐛 Bug Report

When the speed is set to something other than 0, the position of the elements is wrong.
I believe this bug is introduced by #1023, as in if I revert the change seems to work as expected.

To Reproduce

This is the parallax example from the docs website.
I've forked it and try to use the @react-spring/parallax package instead - the API is the same - and it breaks:
https://codesandbox.io/s/reverent-dijkstra-3rwg0?file=/src/index.js

You'll notice three imports:

Expected behavior

The final position of the elements should not be dependent on the speed.

Link to repro (highly encouraged)

See above.

Environment

  • react-spring v9.1.1
  • react v17.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions