1

I'm trying to achieve an animation on blur and focus of TextInput with react-native-reanimated when the keyboard is opening or dismissing, the height will collapse but the problem here is if we have an SVG inside Animated.View it will not collapse like text

logo before collapsing

another pic after collapsing

code on expo

any improvements on the code will be appreciated too

1
  • 1
    I just want to say that having an expo snack linked to the question is super amazing and makes it so much easier to help Commented Feb 28, 2023 at 22:49

1 Answer 1

2

Try to add overflow: 'hidden' to your logoContainer style. Tested on my device, I think it behaves the way you want it.

Hope this helps!

Sign up to request clarification or add additional context in comments.

4 Comments

I tried this but added withTiming to the onBlur and onFocus and it worked. Not to say that it wouldnt work without it but, I imagine the OP is using shared values because he wishes for these values to be animated
@joaocout thank you for your time, it works fine with your solution
@PhantomSpooks, withTiming makes it a little bit laggy when it collapses

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.