Commit bba6afc
authored
perf: don't change
## 📜 Description
Don't change keyboard padding in `KeyboardAwareScrollView` each 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 padding` we don't need to change `inset`
every frame. Instead we can use an optimized approach and:
- add full keyboard frame padding only in the beginning of the animation
(when keyboard appears)
- remove full keyboard frame padding when keyboard fully closed.
Roughly it gives us `2x` less load on UI thread because now we only need
to adjust scroll position inside `onMove` handler. A similar approach is
already used in `KeyboardChatScrollView` (we also change padding only
one time there). So these changes just makes components consistent.
## 📢 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 change `currentKeyboardFrame` each 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):
|iOS|Android|
|---|--------|
|<video
src="https://github.com/user-attachments/assets/9e5f72cc-b6c7-4ea5-999f-d5c56c046809">|<video
src="https://github.com/user-attachments/assets/31f5a675-2de8-4136-91fe-7390364bbb97">|
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changedcurrentKeyboardFrame each frame (#1381)1 parent ecd3bbd commit bba6afc
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
419 | 420 | | |
420 | 421 | | |
421 | 422 | | |
| |||
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
467 | | - | |
468 | | - | |
469 | 468 | | |
470 | 469 | | |
471 | 470 | | |
| |||
0 commit comments