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

useAnimatedKeyboard causes problems with edge-to-edge #235

Closed
SickanK opened this issue Jul 6, 2024 · 2 comments · Fixed by #237
Closed

useAnimatedKeyboard causes problems with edge-to-edge #235

SickanK opened this issue Jul 6, 2024 · 2 comments · Fixed by #237

Comments

@SickanK
Copy link

SickanK commented Jul 6, 2024

Description

Hi there! While reviewing the FAQ, I noticed the section about packages that can interfere with Edge-to-Edge on Android. I'd like to share an issue I recently resolved in my own app where it would unexpectedly switch between Edge-to-Edge mode and the "regular mode".

The cause turned out to be useAnimatedKeyboard from react-native-reanimated. I hadn't set isStatusBarTranslucentAndroid to true, which led to the inconsistent behavior. See documentation.

I'm not entirely certain about the exact conditions that trigger this issue. In my experience, useAnimatedKeyboard functioned correctly on some screens (using react-navigation) but not on others. When it switched over to "regular mode", the app stayed in that mode until restart.

It might be beneficial to add this information to the relevant FAQ section.

Please let me know if this should've a discussion post instead!

Steps to reproduce

  1. Use useAnimatedKeyboard in a React Native app with Unistyles
  2. Leave isStatusBarTranslucentAndroid set to false (which it is by default)
  3. Navigate between different screens in the app

Snack or a link to a repository (optional)

No response

Unistyles version

2.8.2

React Native version

0.73.0

Platforms

Android

Engine

Hermes

Architecture

Paper (old)

@SickanK
Copy link
Author

SickanK commented Jul 6, 2024

After going through my app some more I found that useAnimatedKeyboard was still causing issues with the bottom insets, even with isStatusBarTranslucentAndroid set to true. After following what's mentioned in this comment the problem was partially solved. However, I my guess is that this overrides Unistyles bottom insets...

@jpudysz
Copy link
Owner

jpudysz commented Jul 7, 2024

Can you tell me more? What kind of issue ? Have you tried the latest version 2.8.2? It has additional improvements for the bottom insets.

If the lib is manipulating insets then I can't do anything about it. Android has only one way to check it and it's not indicating if insets were manipulated by lib or by system.

I'm happy to add it to docs but I need more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants