Description
When a searchable List is presented inside a sheet and uses
.searchPresentationToolbarBehavior(.avoidHidingContent) to keep the navigation
bar visible during search, the list cells flicker/blink under the keyboard
This reproduces with public SwiftUI API only — no UIKit, no appearance-proxy customization.
Steps to Reproduce
- Create a new iOS App (SwiftUI) project (deployment target iOS 17.1+).
- Replace the generated App file with the sample code below.
- Run on iOS 26 (reproduces on both device and Simulator).
- Tap "Open transfer methods" to present the sheet.
- Tap the search field so the keyboard is shown (search becomes active).
- Scroll the list down, then up into the top bounce (overscroll)
- Observe the cells under the keyboard.
Expected
Cells scroll smoothly under the keyboard; no flicker.
Actual
Cells under the keyboard flicker/blink during top overscroll. See the attachments with shots of the process: 1. screen before a blink, 2. Screen in the moment of blinking
Sample Code
import SwiftUI
@main
struct FlickerReproApp: App {
var body: some Scene {
WindowGroup { RootView() }
}
}
struct RootView: View {
@State private var isSheetPresented = false
var body: some View {
Button("Open transfer methods") {
isSheetPresented = true
}
.sheet(isPresented: $isSheetPresented) {
NavigationStack {
SimpleSearchScreen()
}
}
}
}
struct SimpleSearchScreen: View {
@State private var searchText = ""
private let items = (0..<40).map { "Recipient \($0)" }
private var filteredItems: [String] {
searchText.isEmpty
? items
: items.filter { $0.localizedCaseInsensitiveContains(searchText) }
}
var body: some View {
List {
ForEach(filteredItems, id: \.self) { item in
Text(item)
}
}
.listStyle(.plain)
.navigationTitle("Transfer methods")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Button("Close", systemImage: "xmark") {}
}
}
.searchable(text: $searchText, placement: .automatic, prompt: "Search")
// Remove the line below -> flicker disappears, but the navigation bar
// (title + toolbar items) then hides during search, which we need to keep.
.searchPresentationToolbarBehavior(.avoidHidingContent)
}
}
Notes / What was ruled out
- Removing
.searchPresentationToolbarBehavior(.avoidHidingContent)eliminates the flicker — but then the navigation bar hides during search, which is exactly the behavior the modifier is meant to prevent. - Presenting the same screen NOT inside a sheet does not flicker — the sheet presentation is required to reproduce.
- Independent of app-level customization: reproduces with no UINavigationBar/UITabBar/UISearchBar appearance proxies and no UIKit.
- Also tried, did NOT help:
.scrollEdgeEffectStyle(.hard, for: .all),.toolbarBackground(.hidden, for: .navigationBar), keeping the bar visible viaUISearchController.hidesNavigationBarDuringPresentation = falseinstead,.geometryGroup()on rows,.scrollDismissesKeyboard(.never), removing safe area insets.