mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 10:25:02 +00:00
Remove overlay pattern from tvOS search results to fix focus clipping
The backgroundStyle.ignoresSafeArea().overlay(ScrollView) pattern clips the tvOS focus effect at the overlay boundary. On tvOS, render the ScrollView directly so focus highlights can extend naturally.
This commit is contained in:
@@ -907,19 +907,21 @@ struct SearchView: View {
|
||||
@ViewBuilder
|
||||
private var resultsViewWithLoading: some View {
|
||||
if searchViewModel != nil {
|
||||
#if os(tvOS)
|
||||
ProgressView()
|
||||
.accessibilityIdentifier("search.loading")
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.top, 40)
|
||||
#else
|
||||
resultsBackgroundStyle.color
|
||||
.ignoresSafeArea()
|
||||
.overlay(
|
||||
ScrollView {
|
||||
VStack(spacing: 16) {
|
||||
#if !os(tvOS)
|
||||
// Filter strip at top (only for instances that support search filters)
|
||||
if searchInstance?.supportsSearchFilters == true {
|
||||
searchFiltersStrip
|
||||
}
|
||||
#endif
|
||||
|
||||
// Loading indicator
|
||||
ProgressView()
|
||||
.accessibilityIdentifier("search.loading")
|
||||
.frame(maxWidth: .infinity)
|
||||
@@ -927,12 +929,34 @@ struct SearchView: View {
|
||||
}
|
||||
}
|
||||
)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var resultsView: some View {
|
||||
if searchViewModel != nil {
|
||||
#if os(tvOS)
|
||||
ScrollView {
|
||||
if layout == .list {
|
||||
listResultsContent
|
||||
} else {
|
||||
gridResultsContent
|
||||
}
|
||||
}
|
||||
.accessibilityLabel("search.results")
|
||||
.background(
|
||||
GeometryReader { geometry in
|
||||
Color.clear
|
||||
.onAppear {
|
||||
viewWidth = geometry.size.width
|
||||
}
|
||||
.onChange(of: geometry.size.width) { _, newWidth in
|
||||
viewWidth = newWidth
|
||||
}
|
||||
}
|
||||
)
|
||||
#else
|
||||
resultsBackgroundStyle.color
|
||||
.ignoresSafeArea()
|
||||
.overlay(
|
||||
@@ -956,6 +980,7 @@ struct SearchView: View {
|
||||
}
|
||||
)
|
||||
)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user