Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Animations no longer support non-pixel values for keyframes #1308

Closed
SamP692 opened this issue Oct 27, 2021 · 2 comments 路 Fixed by #1310
Closed

[BUG] Animations no longer support non-pixel values for keyframes #1308

SamP692 opened this issue Oct 27, 2021 · 2 comments 路 Fixed by #1310
Labels
bug Something isn't working

Comments

@SamP692
Copy link

SamP692 commented Oct 27, 2021

1. Read the FAQs 馃憞

2. Describe the bug

Prior to version 5.0.0, animation keyframes would accept non-pixel values. After installing version 5.0.0, non-pixel will always throw "Keyframes must be of the same dimension as the current value" when used inside an array of keyframes.

Eg.

animate={{ width: ["0px", "100px"] }} works, but animate={{ width: ["0%", "100%"] }} does not.

I could not locate any documentation suggesting this behavior was intentionally deprecated.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

CodeSandbox Example

The example has a "Working Version" component and a "Broken Version" component.

The dependency version can also be rolled back to pre-5.0.0 in CodeSandbox to show the "Broken Version" working.

4. Steps to reproduce

  1. In a React project, install version 4.1.17 of framer-motion
  2. Define a motion.div that animates its width, using <motion.div style={{ /* some styles that'll display the div */ }} animate={{ width: ["0%", "100%"] }}
  3. Confirm that application does not crash when attempting to render the motion.div instance
  4. Install framer-motion version 5.0.0
  5. Reload the application (including any necessary rebuilding), without making any other changes
  6. Confirm that the application crashes when attempting to render the motion.div instance

5. Expected behavior

motion components accept non-pixel based keyframes as they have in the past.

6. Video or screenshots

N/A

7. Environment details

OS: MacOS Big Sur (11.6)
Browser: Chrome 95.0.4638.54

@SamP692 SamP692 added the bug Something isn't working label Oct 27, 2021
@mattgperry
Copy link
Collaborator

Definietly not intended, thanks for the report!

@ndimatteo
Copy link

Getting the same issue when going from 'auto' to 0, which used to work perfectly.

@mergetron mergetron bot closed this as completed in #1310 Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants