Skip to content

Commit

Permalink
Merge pull request #295 from ejensen/fix-tvos-clip
Browse files Browse the repository at this point in the history
`ConsoleView` focus state clipping on tvOS
  • Loading branch information
kean authored Sep 19, 2024
2 parents 1749e31 + 34ed5b0 commit d679320
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/PulseUI/Features/Console/ConsoleView-tvos.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public struct ConsoleView: View {
.onAppear { listViewModel.isViewVisible = true }
.onDisappear { listViewModel.isViewVisible = false }
}
.disableScrollClip()
.injecting(environment)
.environmentObject(listViewModel)
}
Expand Down Expand Up @@ -92,6 +93,17 @@ private struct ConsoleMenuView: View {
}
}

extension View {
@available(tvOS, obsoleted: 17.0, renamed: "scrollClipDisabled")
@ViewBuilder func disableScrollClip() -> some View {
if #available(tvOS 17.0, *) {
scrollClipDisabled()
} else {
self
}
}
}

#if DEBUG
struct ConsoleView_Previews: PreviewProvider {
static var previews: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct NetworkInspectorView: View {
Form { lhs }.frame(width: 740)
Form { rhs }
}
.disableScrollClip()
}

@ViewBuilder
Expand Down

0 comments on commit d679320

Please sign in to comment.