question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android TextInput onFocus snapTo not working correctly

See original GitHub issue

Bug

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

  1. Open Modal A
  2. Click inside the TextInput
  3. Modal should snap to point 2 (‘100%’), but doesn’t always.
  4. 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.

androidSnap

Reproducible sample code

Code on this snack

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
fcandicommented, Jun 8, 2021

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found