perf: don't change currentKeyboardFrame each frame#1381
Merged
kirillzyusko merged 1 commit intomainfrom Mar 19, 2026
Merged
Conversation
Contributor
📊 Package size report
|
2 tasks
kirillzyusko
added a commit
that referenced
this pull request
Mar 21, 2026
## 📜 Description Call `syncKeyboardFrame` after `keyboardHeight` has been set. ## 💡 Motivation and Context If we set call `syncKeyboardFrame` and `keyboardHeight = 0`, then interpolation simply doesn't work we interpolate between `[0, 0]` to `[0, 0]`, so we get `0`. This regression has been introduced after #1381 changes and in this follow-up PR I'm fixing it 🤞 The fix is quite straightforward - we just need to call `syncKeyboardFrame` after updating `keyboardHeight` variable. Closes #1385 ## 📢 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 --> ### JS - call `syncKeyboardFrame` after `keyboardHeight` has been set. ## 🤔 How Has This Been Tested? Tested manually on iPhone 17 Pro (iOS 26.2). ## 📸 Screenshots (if appropriate): |Before|After| |-------|-----| |<video src="https://github.com/user-attachments/assets/70e2fef8-81b0-455d-b877-98067dfd3965">|<video src="https://github.com/user-attachments/assets/08113d77-89b3-4b42-8d0e-f6334c05c602">| ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
2 tasks
kirillzyusko
added a commit
that referenced
this pull request
Mar 23, 2026
## 📜 Description Removed a fix with increased padding by `+1`. ## 💡 Motivation and Context This code has been added in #342 But these changes became irrelevant after #1381 Since we started to change frame to full-height frame once per the animation we no longer have a condition described in #342 Additionally #332 is no longer reproducible, because in #797 we already were fighting with "ghost view" issue and fix for this problem also fixes #332 (just in a different way). So to sum it up: - we no longer need to adjust spacer each frame; - we no longer need a fix with artificial spacer increasing 🤞 ## 📢 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 --> ### JS - don't apply `+1` to keyboard spacer size in `KeyboardAwareScrollView`; ## 🤔 How Has This Been Tested? Tested manually on Redmi Note 5 Pro (Android 9). ## 📸 Screenshots (if appropriate): |Current code|Latest main (before PR changes)|1.20.7 release| |-------------|---------------------------------|-------------| |<video src="https://github.com/user-attachments/assets/7ab3477c-eedd-42da-9af9-5bdb0c842284">|<video src="https://github.com/user-attachments/assets/8697e5e6-84d3-49c5-adb6-2d286cd9ccaa">|<video src="https://github.com/user-attachments/assets/37c9b30c-8aa8-470a-9255-8c4a3d752a95">| ## 📝 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
Don't change keyboard padding in
KeyboardAwareScrollVieweach frame as keyboard moves and do it only in the beginning of the animation (when keyboard appears) or in the end of the animation (when keyboard closed).💡 Motivation and Context
After #797 introduced removal of
ghost paddingwe don't need to changeinsetevery frame. Instead we can use an optimized approach and:Roughly it gives us
2xless load on UI thread because now we only need to adjust scroll position insideonMovehandler. A similar approach is already used inKeyboardChatScrollView(we also change padding only one time there). So these changes just makes components consistent.📢 Changelog
JS
currentKeyboardFrameeach frame;🤔 How Has This Been Tested?
Tested manually on iPhone 17 Pro (iOS 26.2, simulator), Pixel 7 Pro (API 36, real device).
📸 Screenshots (if appropriate):
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-03-19.at.10.55.30.mov
telegram-cloud-document-2-5323806589835054340.mp4
📝 Checklist