Skip to content

fix: request keyboard control only when keyboard will change its position (Android) - #1552

Merged
kirillzyusko merged 1 commit into
mainfrom
fix/kcsv+ios-interpoaltor-on-android
Jul 15, 2026
Merged

fix: request keyboard control only when keyboard will change its position (Android)#1552
kirillzyusko merged 1 commit into
mainfrom
fix/kcsv+ios-interpoaltor-on-android

Conversation

@kirillzyusko

@kirillzyusko kirillzyusko commented Jul 15, 2026

Copy link
Copy Markdown
Owner

📜 Description

Fixed an issue with inability to scroll a KeyboardChatScrollView on Android when KeyboardGestureArea was used with interpolator="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/onEnd when 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 useKeyboardHandler acts as a stateful machine or has side effects. Now with KeyboardChatScrollView it'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

  • request keyboard control only when keyboard position going to be changed;

🤔 How Has This Been Tested?

Tested manually on Pixel 7 Pro (API 36).

📸 Screenshots (if appropriate):

FlatList + non-inverted + whenAtEnd - Fabric app.

Before After
telegram-cloud-document-2-5386323824557989108.mp4
telegram-cloud-document-2-5386323824557989101.mp4

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Jul 15, 2026
@kirillzyusko kirillzyusko added 🐛 bug Something isn't working 🤖 android Android specific 👆 interactive keyboard Anything related to interactive keyboard dismissing labels Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📊 Package size report

Current size Target Size Difference
333089 bytes 333134 bytes -45 bytes 📉

@github-actions

Copy link
Copy Markdown
Contributor

LGTM

@kirillzyusko
kirillzyusko merged commit 6055b47 into main Jul 15, 2026
21 checks passed
@kirillzyusko
kirillzyusko deleted the fix/kcsv+ios-interpoaltor-on-android branch July 15, 2026 17:09
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 android Android specific 🐛 bug Something isn't working 👆 interactive keyboard Anything related to interactive keyboard dismissing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue scolling up with KeyboardChatScrollView when keyboard is open

1 participant