-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: async view removal from
onDetachedFromWindow
(#244)
## 📜 Description Remove `eventView` asynchronously. ## 💡 Motivation and Context It seems that before opening a universal link and before `onDetachedFromWindow` Android takes a snapshot of view hierarchy. Then in `onDetachedFromWindow` we are removing a View and later Android calls `dispatchDetachedFromWindow` for each view from snapshot. But since we've already removed a view it tries to call a method on `null` object reference and we are getting an expected NPE. In this PR I've reworked an approach (to one that was suggested in the thread of the issue). And I remove a view asynchronously. It shouldn't add more new issues, but it'll prevent NPE in the case described above, because we'll remove a view after `dispatchDetachedFromWindow` has been called. Also I've added deep links/universal links to both examples app (paper, fabric). In order to open an app from a link I had to: - long press on app icon - press App Info - press on "Open by default" - add a link (should be suggested automatically) Later I'll try to cover this scenario by e2e tests. Closes #242 ## 📢 Changelog ### Android - call `this.removeKeyboardCallbacks()` as `Handler(Looper.getMainLooper()).post { this.removeKeyboardCallbacks() }` ## 🤔 How Has This Been Tested? Tested on Pixel 7 Pro. ## 📸 Screenshots (if appropriate): https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/e1bbbe48-74f9-4010-a817-fa79354966b6 ## 📝 Checklist - [x] CI successfully passed
- Loading branch information
1 parent
ef0f625
commit 9430657
Showing
5 changed files
with
65 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters