Skip to content

Commit 90dd772

Browse files
authored
fix: KeyboardAwareScrollView regression after optimization (#1387)
## 📜 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
1 parent 2f82c43 commit 90dd772

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/components/KeyboardAwareScrollView

src/components/KeyboardAwareScrollView/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,12 @@ const KeyboardAwareScrollView = forwardRef<
416416
keyboardWillChangeSize ||
417417
focusWasChanged
418418
) {
419-
syncKeyboardFrame(e);
420419
// persist scroll value
421420
scrollPosition.value = position.value;
422421
// just persist height - later will be used in interpolation
423422
keyboardHeight.value = e.height;
423+
// and update keyboard spacer size
424+
syncKeyboardFrame(e);
424425
}
425426

426427
// focus was changed

0 commit comments

Comments
 (0)