mirror of
https://github.com/yattee/yattee.git
synced 2025-11-24 10:18:16 +00:00
Restrict context menu overlay to iOS only
The tap-blocking overlay is only needed on iOS to dismiss the context menu on tap. Removed it from macOS and tvOS where it was either blocking normal interactions or not functional due to platform limitations.
This commit is contained in:
@@ -33,23 +33,21 @@ struct VideoContextMenuView: View {
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
#if os(iOS)
|
||||
// Conditional overlay to block taps on underlying views
|
||||
if isOverlayVisible {
|
||||
Color.clear
|
||||
.contentShape(Rectangle())
|
||||
#if !os(tvOS)
|
||||
// This is not available on tvOS < 16 so we leave out.
|
||||
// TODO: remove #if when setting the minimum deployment target to >= 16
|
||||
.onTapGesture {
|
||||
// Dismiss overlay without triggering other interactions
|
||||
isOverlayVisible = false
|
||||
}
|
||||
#endif
|
||||
.ignoresSafeArea() // Ensure overlay covers the entire screen
|
||||
.accessibilityLabel("Dismiss context menu")
|
||||
.accessibilityHint("Tap to close the context")
|
||||
.accessibilityAddTraits(.isButton)
|
||||
}
|
||||
#endif
|
||||
|
||||
if video.videoID != Video.fixtureID {
|
||||
contextMenu
|
||||
|
||||
Reference in New Issue
Block a user