Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 馃摐 Description Removed `isLaidOut` check from `copyBoundsInWindow` method. ## 馃挕 Motivation and Context When we are using `native-stack` then on initial mount the view property `isLaidOut` will be `true`. When we open a new screen and return back to the previous `isLaidOut` will be `false`. I've tried to call `invalidate`/`requestLayout`/`forceLayout` methods in `onAttachedToWindow` method, but it doesn't seem to have any effect at all. The I decided to compare how `copyBoundsInWindow` works if `isLaidOut` check is removed. And turned out there is no difference between two executions: |Screen opened first time (isLaidOut check present)|Returned to the screen (isLaidOut is missing to go to if-statement)| |---------------------------------------------------|------------------------------------------------------------------| |<img width="709" alt="Screenshot 2023-11-16 at 17 31 24" src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/8f79bfae-3ed8-4e2c-abb6-a8d6a07eab28">|<img width="696" alt="Screenshot 2023-11-16 at 17 52 55" src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/4523be4d-36e7-4733-a71f-de7ff0dc5bd1">| So taking this information into consideration I've decided to remove that check. Also for the sake of safety and avoidance of unexpected crashes I decided to remove `throw Exception` construction and replace it with a simple logger (since I'm not handling exceptions in my code it's better to log it). Closes #274 #203 ## 馃摙 Changelog ### Android - removed `isLaidOut` check from `copyBoundsInWindow` method; - replaced throwing error to logger. ## 馃 How Has This Been Tested? Tested on Pixel 7 Pro (android 14). ## 馃摳 Screenshots (if appropriate): https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/ef8661da-8a78-4d4a-9362-668365736fed ## 馃摑 Checklist - [x] CI successfully passed
- Loading branch information