mirror of
https://github.com/yattee/yattee.git
synced 2026-02-19 17:29:45 +00:00
Fix player dismiss gesture stuck after panel dismiss with comments expanded
Reset isCommentsExpanded and commentsFrame on the NavigationCoordinator directly when the portrait panel is dismissed, since PortraitDetailsPanel owns its own @State that doesn't sync back through .onChange during dismiss. Also track comments overlay frame via GeometryReader so the dismiss gesture can allow swipes outside the comments area instead of blanket-blocking.
This commit is contained in:
@@ -269,6 +269,23 @@ struct ExpandedPlayerSheet: View {
|
||||
}
|
||||
.opacity(isVisible ? 1 : 0)
|
||||
.allowsHitTesting(isVisible)
|
||||
.background(
|
||||
GeometryReader { commentsGeometry in
|
||||
Color.clear
|
||||
.onChange(of: commentsGeometry.frame(in: .global)) { _, newFrame in
|
||||
if isCommentsExpanded {
|
||||
navigationCoordinator?.commentsFrame = newFrame
|
||||
}
|
||||
}
|
||||
.onChange(of: isCommentsExpanded) { _, expanded in
|
||||
if expanded {
|
||||
navigationCoordinator?.commentsFrame = commentsGeometry.frame(in: .global)
|
||||
} else {
|
||||
navigationCoordinator?.commentsFrame = .zero
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
.ignoresSafeArea(edges: .bottom)
|
||||
}
|
||||
@@ -770,6 +787,7 @@ private struct PlayerEventHandlersModifier: ViewModifier {
|
||||
playerState?.commentsState = .idle
|
||||
playerState?.commentsContinuation = nil
|
||||
isCommentsExpanded = false
|
||||
navigationCoordinator?.commentsFrame = .zero
|
||||
isPanelExpanded = false
|
||||
panelExpandOffset = 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user