Skip to content

Commit

Permalink
Merge pull request #107 from yongseongkim/master
Browse files Browse the repository at this point in the history
The visibleHeight's output is wrong when 'Reduce Motion' and 'Prefer Cross-Fade Transitions' are on.
  • Loading branch information
bigMOTOR authored Apr 11, 2023
2 parents c532cc3 + 9c72dc3 commit 63f6377
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/RxKeyboard/RxKeyboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class RxKeyboard: NSObject, RxKeyboardType {
)
let frameVariable = BehaviorRelay<CGRect>(value: defaultFrame)
self.frame = frameVariable.asDriver().distinctUntilChanged()
self.visibleHeight = self.frame.map { UIScreen.main.bounds.height - $0.origin.y }
self.visibleHeight = self.frame.map { UIScreen.main.bounds.intersection($0).height }
self.willShowVisibleHeight = self.visibleHeight
.scan((visibleHeight: 0, isShowing: false)) { lastState, newVisibleHeight in
return (visibleHeight: newVisibleHeight, isShowing: lastState.visibleHeight == 0 && newVisibleHeight > 0)
Expand Down

0 comments on commit 63f6377

Please sign in to comment.