kirillzyusko / react-native-keyboard-controller

Keyboard manager which works in identical way on both iOS and Android
https://kirillzyusko.github.io/react-native-keyboard-controller/
MIT License
1.54k stars 61 forks source link

fix: missing `height` deps in `KeyboardAwareScrollView` component #501

Closed kirillzyusko closed 1 month ago

kirillzyusko commented 1 month ago

📜 Description

Added height to deps of maybeScroll function.

💡 Motivation and Context

When we mount component and height is updated later (windowDidResize is emitted after component mount), then we receive height=0 in maybeScroll. This PR fixes this.

Also I removed height from useSmoothKeyboardHandler because we don't use this value in the hook and we have maybeScroll in dependencies.

Closes https://github.com/kirillzyusko/react-native-keyboard-controller/issues/499

📢 Changelog

JS

🤔 How Has This Been Tested?

Tested manually on Pixel 3A (API 33, emulator).

📸 Screenshots (if appropriate):

Before After
Screenshot 2024-07-09 at 10 51 38 Screenshot 2024-07-09 at 10 50 47

📝 Checklist

github-actions[bot] commented 1 month ago

📊 Package size report

Current size Target Size Difference
145278 bytes 145278 bytes 0 bytes 📉