mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 02:45:03 +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
|
@ViewBuilder
|
||||||
private var resultsViewWithLoading: some View {
|
private var resultsViewWithLoading: some View {
|
||||||
if searchViewModel != nil {
|
if searchViewModel != nil {
|
||||||
|
#if os(tvOS)
|
||||||
|
ProgressView()
|
||||||
|
.accessibilityIdentifier("search.loading")
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.padding(.top, 40)
|
||||||
|
#else
|
||||||
resultsBackgroundStyle.color
|
resultsBackgroundStyle.color
|
||||||
.ignoresSafeArea()
|
.ignoresSafeArea()
|
||||||
.overlay(
|
.overlay(
|
||||||
ScrollView {
|
ScrollView {
|
||||||
VStack(spacing: 16) {
|
VStack(spacing: 16) {
|
||||||
#if !os(tvOS)
|
|
||||||
// Filter strip at top (only for instances that support search filters)
|
|
||||||
if searchInstance?.supportsSearchFilters == true {
|
if searchInstance?.supportsSearchFilters == true {
|
||||||
searchFiltersStrip
|
searchFiltersStrip
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Loading indicator
|
|
||||||
ProgressView()
|
ProgressView()
|
||||||
.accessibilityIdentifier("search.loading")
|
.accessibilityIdentifier("search.loading")
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
@@ -927,12 +929,34 @@ struct SearchView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var resultsView: some View {
|
private var resultsView: some View {
|
||||||
if searchViewModel != nil {
|
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
|
resultsBackgroundStyle.color
|
||||||
.ignoresSafeArea()
|
.ignoresSafeArea()
|
||||||
.overlay(
|
.overlay(
|
||||||
@@ -956,6 +980,7 @@ struct SearchView: View {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user