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

fix: ignore non-visible keyboard #473

Closed kirillzyusko closed 3 weeks ago

kirillzyusko commented 3 weeks ago

📜 Description

Ignore non visible keyboard in KeyboardView.find() method.

💡 Motivation and Context

Sometimes we may have two keyboards:

image

And the current algorithm for a search returns an invalid keyboard (not a one that is actually shown on the screen):

image

or

image

But when actual keyboard is tracked, then the frame of this keyboard has non-zero height:

image

So to fix the problem with invalid keyboard view being found I decided to modify a condition and add additional condition to check that frame.height != 0.

Follow up for https://github.com/kirillzyusko/react-native-keyboard-controller/pull/471 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/338#issuecomment-2163904827

📢 Changelog

iOS

🤔 How Has This Been Tested?

Tested on CI (e2e tests).

📝 Checklist

github-actions[bot] commented 3 weeks ago

📊 Package size report

Current size Target Size Difference
144018 bytes 144004 bytes 14 bytes 📈