-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Keyboard SharedValue stop responding on Android when using WebBrowser after installing unistyles #404
Comments
Hey! Thanks for the report. Based on your description, I can already explain why this is happening. I’m not sure if there’s anything I can do about it or if you should open an issue in the Reanimated repo. This issue occurs only on Android because Unistyles 2.8+ enforces edge-to-edge layout. Additionally, when you return from a web browser session, Unistyles once again enforces edge-to-edge layout (when app comes to foreground). I’m not sure how Reanimated handles this, and I can’t check it right now, but that’s my assumption. To confirm, you can either install Unistyles 2.7.2 and try reproducing the issue or uninstall Unistyles and install react-native-edge-to-edge, which functions the same way as Unistyles (forces edge to edge). I hope this provides more clarity. Unfortunately, I can’t disable edge-to-edge layout since I rely on Android’s inset system, which requires it. Also, with the release of Android 15, this has become the standard. I can be mistaken, so if that's not the case then please let me know I will try to find the root cause. |
Thank you for your response. I tried to reproduce with 2.7.2 and indeed the issue does not occur. However, installing react-native-edge-to-edge did not cause the issue. I also tried react-native-keyboard-controller, which enforces edge-to-edge (see here), and observed no issue. So I suspect this issue is not caused by edge-to-edge per-se. Also, to clarify - the issue does not occur each time the app comes to the foreground. I could only reproduce it so far after coming back from a WebBrowser session. |
That was the main change compared to version 2.8.0. Additionally, reading the keyboard height is based on IME insets (keyboard insets), so it must be related to that. Unistyles does not modify any insets, it only reads them and forces edge-to-edge rendering. I'm not sure how I can help with this issue as I'm not blocking Animated from reading these values. |
Nevertheless will try to debug your repro (thank you for that) in free time, maybe I will find the problem |
Description
After returning to the application from a WebBrowser session, the keyboard related SharedValues from react-native-reanimated or react-native-keyboard-controller stop responding to keyboard changes until the app is closed and reopened.
This is problematic since WebBrowser is a common way to perform authentication for social login. After the user gets redirected back to the app, all dependencies on the keyboard's shared value stop working.
Importantly, one does not need to use any feature of unistyles for this to manifest. Simply configuring unistyles causes the issue.
The issue could not be reproduced on iOS.
Steps to Reproduce
In the reproduction repo:
On the main branch, the animated view would work. On unistyles-2.20 or unistyles-3 branches, the view would stop responding.
Snack or Repository Link (Optional)
https://github.com/vaharoni/expo-webbrowser-keyboard-issue
Unistyles Version
Both 3.0 and 2.20
React Native Version
0.76.3
Platforms
Android
Expo
Yes
The text was updated successfully, but these errors were encountered: