motiondivision / motiondivision/motion

[BUG] Framer Motion Animation doesn't work on reload without delay

Open
#2,598 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
33.7k
Forks
1.4k
Avg merge
1d 10h
Merged PRs (30d)
14

Description

1. Read the FAQs 👇

2. Describe the bug

If I have two components that should be animated as soon as they are visible, they will not be animated when I reload the page with CTRL + R. Only when I reload the page with CTRL + SHIFT + R the animation appears.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

Unfortunately I couldn't reproduce the bug in CodeSandbox because the reload mechanism seems to work differently there, but the bug is also there in Stackblitz.
https://stackblitz.com/edit/vitejs-vite-cbkvjz?file=src%2FApp.jsx&terminal=dev

4. Steps to reproduce
Steps to reproduce the behavior:

  1. Open https://stackblitz.com/edit/vitejs-vite-cbkvjz?file=src%2FApp.jsx&terminal=dev
    and then https://vitejsvitecbkvjz-evfn--5173--134daa3c.local-credentialless.webcontainer.io/ (the second url is just the fullscreen version)
  2. In the second url click on connect project after a few seconds
  3. Press CTRL + R or click on the reload button of your browser
  4. The animation doesn't really work

If you press CTRL + SHIFT + R, the animation will work fine.

5. Expected behavior

When I reload the page the animation should run normally, even without shift.

6. Video or screenshots

---

7. Environment details
Windows 11 23H2; Chrome 123.0.6312.59

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction and compare a normal browser reload with Ctrl+Shift+R in the fullscreen page. Investigate why the animation fails after Ctrl+R on the reported Windows 11 and Chrome environment. Done means the animation runs normally after a standard reload; no source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript, vite
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.