Use toolbar search placement on iPad channel view

The navigationBarDrawer search field on iPad added a resting scroll
position above the banner on iOS 27, letting the view scroll past the
banner top with the mirrored banner filling the gap. iPhone keeps the
drawer placement since its header reserves space for the search bar.
This commit is contained in:
Arkadiusz Fal
2026-07-18 12:54:47 +02:00
parent 74442f2764
commit e905932cfa

View File

@@ -208,10 +208,16 @@ struct ChannelView: View {
content()
#if os(iOS)
.if(supportsChannelSearch) { view in
// iPhone: search bar drawer in the navigation area (header reserves
// space for it). iPad: toolbar search button the drawer would add
// a resting scroll position above the banner, letting the view
// scroll past the banner top.
view.searchable(
text: $searchText,
isPresented: $isSearchActive,
placement: .navigationBarDrawer(displayMode: .automatic),
placement: horizontalSizeClass == .compact
? .navigationBarDrawer(displayMode: .automatic)
: .toolbar,
prompt: Text("channel.search.placeholder")
)
}