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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Issue animating logical properties inset-inline-start and inset-inline-end #1989

Closed
danhollick opened this issue Mar 2, 2023 · 2 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@danhollick
Copy link

Framer motion doesn't seem to support animating logical properties like inset-inline-start and inset-inline-end. These should work the same as their physical counterparts, left and right.

Using framer-motion:10.0.1 and react:18.20.

Here's a reproduction of the issue. For some reason the animation only works in one direction using inset-inline-start and inset-inline-end but as you can see it doesn't tween between the two values.

Screen.Recording.2023-03-02.at.09.14.26.mov
@danhollick danhollick added the bug Something isn't working label Mar 2, 2023
@mattgperry mattgperry added the wontfix This will not be worked on label Mar 2, 2023
@mattgperry
Copy link
Collaborator

mattgperry commented Mar 2, 2023

We do support animating left/right in the manner shown here but the way we do this is pretty legacy, I kind of wish it wasn't in there. Even so animating left/right is relatively common whereas inset-inline-start and inset-inline-end isn't - so it's not something I'm going to add where you could animate them in the same way.

However, the way I'd recommend animating these props is the same way I'd recommend animating left/right. Which is, changing them via style and adding a layout prop.

<motion.div 
  layout
  transition={{ type: "tween", duration: 0.25, ease: "easeInOut" }}
  style={{
    insetInlineStart: rtl ? 0 : "auto",
    insetInlineEnd: rtl ? "auto" : 0
  }}
/>

This way the animation itself happens via transform which is more performant than animating these values directly.

@danhollick
Copy link
Author

@mattgperry gotcha.

I was trying to leverage variant propagation for something but I think I could work around that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants