Android TextInput onFocus snapTo not working correctly
See original GitHub issueBug
When clicking inside a TextInput and running a function onFocus
to snap a bottom sheet to a specific snap point doesn’t always run with Android (Works on iOS).
Environment info
Library | Version |
---|---|
@gorhom/bottom-sheet | 2.2.6 |
Steps To Reproduce
Go to this snack
- Open Modal A
- Click inside the TextInput
- Modal should snap to point 2 (‘100%’), but doesn’t always.
- If it does work, then open Modal B, dismiss the keyboard by clicking the search icon. Open modal A and try again
This happens on the simulator as well as actual devices (old and new)
You can see the modal collapses to snap point 0 and you can see it also in the console log.
iOS works as it should.
Reproducible sample code
Code on this snack
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Almost impossible to focus TextInput in React Native Android
I'm using React Native TextInput on Android. The problem is that you have to press it multiple times for it to work .....
Read more >Text Field - Text goes below the IME [192043120]
This cause the issue: If I understood correctly the problem is not the keyboard itself, when the activity is resized the items of...
Read more >Modifier - Android Developers
A modifier that can be used to observe focus state events. ... to provide ModifierLocal s that can be read by other modifiers...
Read more >Fixed issues in Illustrator releases - Adobe Support
See the list of issues that we've fixed in the latest release of ... The SVG file exported through Export for screens does...
Read more >react-spring-bottom-sheet - npm
a RESIZE event happens, like when an Android device shows its soft keyboard when an text editable input receives focus, as it changes...
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
@gorhom Thanks the Patch working great 😃
@kickbk I also head the problem only on Android that there was a automatic keyboard handling that interfered with the Bottom Sheet snap points. That is, because I had a configuration in AndroidManifest.xml in “activity” : “android:windowSoftInputMode”. There are several options, I now use "android:windowSoftInputMode=“adjustPan” and its working great.
@fcandi you need to apply this patch https://github.com/gorhom/react-native-bottom-sheet/blob/v4/example/patches/react-native-gesture-handler%2B1.10.3.patch 👍