react-native-keyboard-controller 1.20.3 → 1.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,7 +66,14 @@ public final class KeyboardTrackingView: UIView {
66
66
  }
67
67
 
68
68
  @objc public func attachToTopmostView(toWindow window: UIWindow? = nil) {
69
- guard let topView = (window?.rootViewController ?? UIApplication.topViewController())?.view else { return }
69
+ var topViewController = window?.rootViewController
70
+ if let rootVC = topViewController, let topView = rootVC.view, topView.window != nil {
71
+ // ok, attach
72
+ } else {
73
+ topViewController = UIApplication.topViewController()
74
+ }
75
+
76
+ guard let topView = topViewController?.view else { return }
70
77
 
71
78
  if currentAttachedView === topView { return }
72
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-keyboard-controller",
3
- "version": "1.20.3",
3
+ "version": "1.20.4",
4
4
  "description": "Keyboard manager which works in identical way on both iOS and Android",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",