We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents be305c2 + 4b9cbe9 commit a5b53e1Copy full SHA for a5b53e1
Sources/RxKeyboard/RxKeyboard.swift
@@ -62,11 +62,10 @@ public class RxKeyboard: NSObject, RxKeyboardType {
62
self.visibleHeight = self.frame.map { UIScreen.main.bounds.height - $0.origin.y }
63
self.willShowVisibleHeight = self.visibleHeight
64
.scan((visibleHeight: 0, isShowing: false)) { lastState, newVisibleHeight in
65
- return (visibleHeight: newVisibleHeight, isShowing: lastState.visibleHeight == 0)
+ return (visibleHeight: newVisibleHeight, isShowing: lastState.visibleHeight == 0 && newVisibleHeight > 0)
66
}
67
.filter { state in state.isShowing }
68
.map { state in state.visibleHeight }
69
- .skip(1)
70
self.isHidden = self.visibleHeight.map({ $0 == 0.0 }).distinctUntilChanged()
71
super.init()
72
0 commit comments