-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
TextInput does not stick in the right place with KeyboardAvoidingView and ScrollView #402
Comments
Hey @irekrog I think this is kind of expected behavior, since In your layout I think I'd recommend to use Plus I see that additionally you are moving your content by |
On iOS it looks a much better, so I'm not sure what is wrong 😕 RPReplay_Final1711368735.MP4
Yes, because I want to hide the image outside a screen window when keyboard is active. Exactly like on this recorded video from iPhone. |
@kirillzyusko and I'm trying to use |
@irekrog what happens here: I don't see a keyboard, but according to Submit button it's kind of visible? |
@kirillzyusko yep, it's a problem with recorded video because actually there is a keyboard |
I don't know why iPhone behaves in this way, but on the layout that you provided:
Maybe because of layout animations (or some internal stuff inside) iOS itself does a little bit magic and changes view positions to what you expect, but on Android it'll not work for sure I think. I'll test your layout when I have time (but can not promise it'll be soon, because I have a plenty of work with keyboard controller at the moment 😅) And yeah, last but not least - you can create your own avoiding solution that will be specific for your layout:
Using all these variables you'll be able to calculate necessary layout adjustments.
Can you share a code sample with I think |
Sure I'll try, and thanks for tips :)
Nothing special, I just changed component from |
Okay, got you! Then I think the problem happens because of these additional 400px translation - potentially resizing content (changing real layout) may fix the problem, but of course need to try 🙂 Feel free to share your observations here - I'll try to help if I can 😅 |
@irekrog I'm going to close this issue. I hope I provided the answer on how to achieve desired behavior Maybe in future this library will be able to synchronously retrieve a layout of focused input in each keyboard frame, and your use case will work out of the box 👍 |
Describe the bug
When the content is scrolled to the bottom, halfway down the screen, etc., and the input is pressed, it is not always properly sticked and visible
Code snippet
Repo for reproducing
You can paste a code above to
src/screens/Examples/KeyboardAvoidingView/index.tsx
in this repoExpected behavior
TextInput should stick to the right place
Screenshots
Screen_Recording_20240325_122220_KeyboardController.Example.mp4
Smartphone
The text was updated successfully, but these errors were encountered: