Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.
This repository was archived by the owner on Nov 12, 2024. It is now read-only.

[Bug] Animation does not work very well whe driven by watch in a vue application #220

@thomasaull

Description

@thomasaull

1. Describe the bug

I'm using motion one in a Vue project where I want to do the following:

  • A gsap timeline drives the animation of a value
  • I pass the value to a component as a prop
  • The value should drive a motion one animation

When I'm trying to call the animate() function in a Vue watcher with requestAnimationFrame it does not work (Example 1 in Codesandbox). If instead use a requestAnimationFrame loop it does (Example 2 in Codesandbox). Please comment in/out the code accordingly.

2. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://codesandbox.io/s/confident-mendeleev-pvgqmc?file=/src/components/Animation.vue

3. Steps to reproduce

Steps to reproduce the behavior:

  1. Open Codesandbox Link
  2. Example does not work
  3. Comment out Example 1 and comment in Example 2
  4. Example does work

4. Expected behavior

I'm not sure if its a limitation of the library or if I'm doing something wrong. My expectation would be that I can drive the animation with the watcher. This for example works as expected when using gsap: https://codesandbox.io/s/charming-easley-4gw4gp?file=/src/components/Animation.vue

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions