Bug (spring): combining opacity with translate will hide element on web after animation
See original GitHub issueCombining 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:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in upcoming Reanimated
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