react-native-animatable icon indicating copy to clipboard operation
react-native-animatable copied to clipboard

Animation doesn't stay in it's view

Open mikeKane opened this issue 5 years ago • 4 comments

I've created an animation and it animated great! Thank you for a great library.

However it doesn't stay in its container. Notice it should stay with in the yellow view

animated

mikeKane avatar Mar 29 '19 17:03 mikeKane

I can also confirm that. Is there a fix or proper way of handling that?

Thanks

marcosmartini avatar Apr 02 '19 23:04 marcosmartini

I've tried overFlow = hidden. Not sure what else I can do.

mikeKane avatar Apr 03 '19 13:04 mikeKane

This works for me (react-native 0.61.1, [email protected]):

<View style={{ overflow: 'hidden' }}> <Animatable.View animation="slideInDown" useNativeDriver={true} > ... </Animatable.View> </View>

genesisxyz avatar Sep 30 '19 16:09 genesisxyz

Another option is to override the translations happening. For example, I was using slideInDown which just animates translateY by -100 (see here) so I replaced it with a custom animation reducing the translateY value to fit:

<AnimatedComponent
  animation={{
    from: { translateY: -10 },
    to: { translateY: 0 },
  }}
  direction="alternate"
  iterationCount="infinite"
  duration={500}
  useNativeDriver={true}
/>

For me, this avoided the issue of the animated component disappearing when using overflow: hidden.

BrianH2 avatar Mar 22 '20 08:03 BrianH2