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.62k stars 67 forks source link

fix: detect only vertical ScrollView for `parentScrollViewTarget` #443

Closed kirillzyusko closed 4 months ago

kirillzyusko commented 4 months ago

📜 Description

parentScrollViewTarget returns only vertical ScrollView.

💡 Motivation and Context

Actually it was an inconsistency between Android and iOS. On Android we are checking that instance belongs to ScrollView. If it's <ScrollView horizontal then on Android it'll render HorizontalScrollView so will not go into if (parentView is ScrollView) { statement.

To achieve a similar behavior on iOS I added a check where compare frame and contentSize to assure that ScrollView is a vertical.

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

📢 Changelog

iOS

🤔 How Has This Been Tested?

Tested on iPhone 14 Pro.

📸 Screenshots (if appropriate):

Before After
image image

📝 Checklist

github-actions[bot] commented 4 months ago

📊 Package size report

Current size Target Size Difference
136074 bytes 135974 bytes 100 bytes 📈