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 (spring): combining opacity with translate will hide element on web after animation

See original GitHub issue

Combining opacity with translate will hide element on web after animation. (opacity will be set back to 0) This only happens with spring (also tried overshootClamping: false) I also tried the old way (without transform array) and the result is the same. It does the animation and hides it afterwards.

Works fine with type: "timing"

<MotiView
    from={{ opacity: 0, transform: [{ translateY: 100 }] }}
    animate={{ opacity: 1, transform: [{ translateY: 0 }] }}
    style={styles.title}
>

This works fine:

<MotiView
    from={{ opacity: 0, transform: [{ translateY: 100 }] }}
    animate={{ opacity: 1, transform: [{ translateY: 0 }] }}
    style={styles.title}
    transition={{ type: "timing" }}
>

Using opacity or transform alone, nothing breaks (even on spring). It just happens when combining them.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nandorojocommented, Oct 26, 2021

Fixed in upcoming Reanimated

0reactions
nandorojocommented, Oct 12, 2021

you should try importing the web patch used in Reanimated 2.3.0-beta.2 (I think that’s it), or downgrade to RNW 0.15.6

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS transition with visibility not working - Stack Overflow
If you use opacity:0 only, your transparent menu will still be there and it will animate when you hover the invisible area. But...
Read more >
Advanced CSS Animation Using cubic-bezier()
By using cubic-bezier(0,V,1,V) where V is some very big value and both the initial and final states are very close together (or almost...
Read more >
An Interactive Guide to CSS Transitions - Josh W Comeau
This comprehensive guide shows how to use CSS transitions! A back-to-basics look at the fundamental building blocks we need to create ...
Read more >
Animating Views and Transitions — SwiftUI Tutorials
Animating Views and Transitions. When using SwiftUI, you can individually animate changes to views, or to a view's state, no matter where the...
Read more >
Animating from "display: block" to "display: none"
(As a side point here, even if you combined opacity: 0 with visibility: hidden , it would animate just fine but the element...
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