fix: request keyboard control only when keyboard will change its position (Android) - #1552
Merged
Merged
Conversation
Contributor
📊 Package size report
|
Contributor
|
LGTM |
kirillzyusko
added a commit
that referenced
this pull request
Jul 20, 2026
## 📜 Description Cover basic functionality of `KeyboardChatScrollView` with e2e tests. ## 💡 Motivation and Context This is something that I wanted to do for a very long time. But when I built first e2e test kit I realized that #1552 was a blocker (it failed Android tests time to time). Recently I fixed that and it unblocked this PR. However now I realized that `useExtraContentPadding` seems to be flaky as well 🤷♂️ (produces different scroll time-to-time). But I'll leave it for future - for now I just disabled test with `.skip` ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### E2E - added `KeyboardChatScrollView` tests; ## 🤔 How Has This Been Tested? Tested via this PR. ## 📸 Screenshots (if appropriate): <img width="502" height="309" alt="image" src="https://github.com/user-attachments/assets/8d078f89-d5b8-4b91-8c52-7abdb93e079e" /> ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Fixed an issue with inability to scroll a
KeyboardChatScrollViewon Android whenKeyboardGestureAreawas used withinterpolator="ios".💡 Motivation and Context
The issue was in fact that we were starting keyboard control request too early. As a result it emitted events
onStart/onMove/onEndwhen keyboard didn't change position. Current JS code expects to receive these events when position is getting actually changed - in this case we control scroll position and adjust it accordingly.If we receive those events when keyboard is not moving then we'll try to change position and it will look like a missing momentum gesture, content flickering etc.
Before we were not able to catch this problem, because we didn't have an example where
useKeyboardHandleracts as a stateful machine or has side effects. Now withKeyboardChatScrollViewit's clear where the bug is, so we are fixing it. Before we were just mapping events to animated values to "translate" a view and it was working, because all three events were reporting actually correct values (like keyboard is shown).Closes #1405
📢 Changelog
Android
🤔 How Has This Been Tested?
Tested manually on Pixel 7 Pro (API 36).
📸 Screenshots (if appropriate):
FlatList + non-inverted + whenAtEnd - Fabric app.
telegram-cloud-document-2-5386323824557989108.mp4
telegram-cloud-document-2-5386323824557989101.mp4
📝 Checklist