question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Chakra UI components using `motion` animations stuck in `initial`

See original GitHub issue

1. Read the FAQs 👇

✅ Unsure if this is related to the AnimatePresence key FAQ or not. I tried adding an unchanging key in a number of places with no change.

2. Describe the bug

We’ve had a number of issues opened for Chakra UI that many of our components that rely on framer-motion (like Modal) are not appearing. We’ve discovered that framer-motion@4.1.11 is the most recent version where animations work correctly.

It looks like the components are rendering correctly but are not leaving their initial state. In the repro below, inspecting the page shows that the modal content elements are all there, but the outer wrapper has the following style:

opacity: 0;
transform: scale(0.95) translateZ(0px);

This is consistent with the exit variant we defined, which is the initial and exit variant for this animation.

Here are a few links to relevant sections of the Chakra codebase:

As noted above, I tried adding an unchanging key in various places throughout just to see if that might be part of the issue and nothing seemed to make a difference.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

Broken (4.1.13): https://codesandbox.io/s/proud-violet-3gqny?file=/pages/index.tsx Working (4.1.11): https://codesandbox.io/s/flamboyant-jackson-i9ouh?file=/pages/index.tsx

4. Steps to reproduce

Steps to reproduce the behavior:

  1. Click “Open Modal”

5. Expected behavior

The modal animates correctly.


If there’s any other information I can provide or if pairing to investigate within our codebase would be helpful, I am happy to help!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

1reaction
mattgperrycommented, May 12, 2021

Wooo!

1reaction
mattgperrycommented, May 12, 2021

@paambaati How did you verify this? I’ve had inconsistent results simply version bumping Next.js sandboxes in CodeSandbox

Seems to work for me: https://codesandbox.io/s/autumn-water-s7nor

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chakra UI + Framer Motion
This example shows how to add some interesting motion interaction or animation to your Chakra UI websites or apps with Framer Motion.
Read more >
Animating Chakra Ui Components On Scroll - YouTube
A walkthrough of how to run transitions on our Chakra components when they enter the viewport. Chakra template project ...
Read more >
Newest 'framer-motion' Questions - Stack Overflow
I am using framer-motion, but I can not make the animation work. import React, { Component } from 'react'; ... reactjs · framer-motion...
Read more >
21 Best React Component Libraries To Try In 2021
React is a JavaScript library that lets you develop a top UI for both web and mobile applications. It conveniently integrates with other ......
Read more >
List of Known Bugs and Issues | Genshin Impact - Game8
Known Issues in Version 3.0. Date, No. Past Issues. 09/15 2022, 1, Characters Movement Bug. Fixed an issue where ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found