Skip to content

Commit

Permalink
Fix bug where user could make a view come back from hidden state, res…
Browse files Browse the repository at this point in the history
…ulting in a bad UI state. (#54)
  • Loading branch information
ntnmrndn committed Jan 25, 2023
1 parent c53af50 commit 9476ddf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Rideau/RideauHostingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ final class RideauHostingView: RideauTouchThroughView {

private var isInteracting: Bool = false

private var isTerminated: Bool = false

private var shouldUpdateLayout: Bool = false

private var oldValueSet: CachedValueSet?
Expand Down Expand Up @@ -419,6 +421,7 @@ final class RideauHostingView: RideauTouchThroughView {
}

@objc private dynamic func handlePan(gesture: UIPanGestureRecognizer) {
guard self.isTerminated == false else { return }

func currentHidingOffset() -> CGFloat {

Expand Down Expand Up @@ -837,7 +840,9 @@ final class RideauHostingView: RideauTouchThroughView {
}
)

isInteracting = false
if target.source == .hidden {
self.isTerminated = true
}
}
default:
break
Expand Down Expand Up @@ -877,7 +882,6 @@ final class RideauHostingView: RideauTouchThroughView {
delegate?.rideauView(self.parentView!, willMoveTo: target.source)
handlers.willMoveTo?(target.source)
}

}

assert(currentSnapPoint != nil)
Expand Down

0 comments on commit 9476ddf

Please sign in to comment.