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.4k stars 55 forks source link

fix: consume context values as a default one #399

Closed kirillzyusko closed 3 months ago

kirillzyusko commented 3 months ago

📜 Description

Consume context values (as default values).

💡 Motivation and Context

When we navigate between screens, sometimes there can be a situation, where keyboard is not moving. If we initialize values as a default one - we'll have incorrect layout, because keyboard is actually shown (and wasn't moved) so we will continue to use default values (keyboard closed) while keyboard is actually open.

To fix this problem I specify default values from the context - context always holds a current values. It fixes the problem 🙂

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

📢 Changelog

JS

🤔 How Has This Been Tested?

Tested on Android 10.

📸 Screenshots (if appropriate):

Before After
image image

📝 Checklist

kirillzyusko commented 3 months ago

@breakingrobot may I kindly ask you to test this PR? 🙏

I believe it should fix the problem 😊

github-actions[bot] commented 3 months ago

📊 Package size report

Current size Target Size Difference
130195 bytes 130012 bytes 183 bytes 📈
breakingrobot commented 3 months ago

@breakingrobot may I kindly ask you to test this PR? 🙏

I believe it should fix the problem 😊

I'll try that today and let you know!

breakingrobot commented 3 months ago

@kirillzyusko Seems good to me :)

kirillzyusko commented 3 months ago

@breakingrobot okay, thank you! I'll merge it and publish 1.11.5 soon 👀