motiondivision / motiondivision/motion

[BUG] Blinking on Enter and Exit Animations with layoutId and AnimatePresence

Open
#2,616 2 comments 4 reactions 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

When using AnimatePresence with elements that have a layoutId, the components blink upon entering and exiting. The expected smooth transition is interrupted by a sudden change in opacity, making the components momentarily disappear or flash.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://codesandbox.io/p/sandbox/frosty-fast-dc5lt8?file=%2Fsrc%2FApp.tsx

4. Steps to reproduce

To observe the behavior:

Open the provided CodeSandbox link.
Click on any item to select it and trigger the animation.
Notice the blinking as the selected item enters or exits the view.

5. Expected behavior

The expected behavior is a smooth transition for components entering and exiting without any blinking. Elements with layoutId should animate their layout changes seamlessly under AnimatePresence.

6. Video or screenshots

https://github.com/framer/motion/assets/14288396/c9a04dd9-1554-4c04-b1eb-a713c7719b4e

7. Environment details

OS: macOS 13.0
Browser: Chrome 123.0.6312.105
Framer Motion version: 11.0.25

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 CodeSandbox reproduction and inspect how AnimatePresence interacts with layoutId during selection, entry, and exit. Confirm the blinking in the stated environment, then trace the relevant animation behavior and add or update coverage if the project provides a matching test area. Done means the transitions remain smooth without opacity flashes.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.