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

refactor: move `findKeyboardView` in separate file #390

Closed kirillzyusko closed 5 months ago

kirillzyusko commented 5 months ago

📜 Description

Moved findKeyboardView in separate file.

💡 Motivation and Context

KeyboardMovementObserver is already pretty big file (250+ lines of the code). When we add new code then we get a lint warning telling, that files shouldn't be bigger than 250 lines of the code (excluding comments).

So in this PR I'm moving findKeyboardView function into separate file - this is a pure function with a clearly defined functionality, so it's an ideal candidate for splitting the code.

Initially I wanted to add it as extensions, but since we already have traversal folder - I decided to put it there, because in order to find a keyboardView we need to traverse through windows 🙂

📢 Changelog

iOS

🤔 How Has This Been Tested?

Tested on iPhone 14 Pro (iOS 17.2, real device) + CI.

📝 Checklist

github-actions[bot] commented 5 months ago

📊 Package size report

Current size Target Size Difference
129688 bytes 129578 bytes 110 bytes 📈