iOS 27 regression - minimized search item in top toolbar breaks its state

struct ContentView: View {
    @State var searchText: String = ""
    var body: some View {
        TabView {
            Tab {
                NavigationStack {
                    List {
                        Text("Hello!")
                        Text("Hello!")
                        Text("Hello!")
                        Text("Hello!")
                        Text("Hello!")
                        Text("Hello!")
                    }
                    .navigationTitle("Have a title")
                    .searchable(text: $searchText, placement: .toolbar)
                    .searchToolbarBehavior(.minimize)
                    .toolbar {
                        DefaultToolbarItem(kind: .search, placement: .topBarTrailing)
                    }
                }
            }
        }
    }
}

In iOS 26, this worked no problem. In iOS 27, this leaves the search bar either unable to collapse (when pressing the close button) or in a broken state where it cannot be opened again.

Answered by DTS Engineer in 905308022

Hello @EthanRDoesMC

In iOS 26, this worked no problem

I took a look at your project, and tested the same code on iOS 26.5 (build 23F77) and saw a similar hang.

I want to make sure this is the same result you are seeing, and I'd like to communicate this to the teams that may see your report.

To make sure Apple sees exactly the same issue you are describing, can you include more information:

  • A screen recording or logs that demonstrate the issue.
  • Specific versions or build numbers when you noticed this code was working as expected. Include all software and hardware versions used in testing.
  • Does this reproduce when the app is not attached to Xcode's debugger?

To test this: build and run the app once from Xcode, then either (1) stop the session and manually relaunch the app from the Home Screen/Springboard rather than pressing Run again, or (2) select Debug > Detach from [App Name] in Xcode's menu bar while the app is still running, then reproduce the hang.

If you need to capture logs in that state, use Console.app (connect the device, filter by your app's bundle ID/process name, per Apple's guidance on accessing device console logs) rather than relying on Xcode's debug console, since Xcode's console is a debugging session view and won't be available/attached once you've detached lldb.

Include the updated files and information in your report. Let me know in this thread once completed and I will make sure that report is routed to the correct team.

Thank you,

 Travis

FB24779236

I have just written a Feedback Assistant report for this issue

I just spent two afternoons trying to fix this until I ran into this post. For the love of God Apple fix this!

Hello @EthanRDoesMC

In iOS 26, this worked no problem

I took a look at your project, and tested the same code on iOS 26.5 (build 23F77) and saw a similar hang.

I want to make sure this is the same result you are seeing, and I'd like to communicate this to the teams that may see your report.

To make sure Apple sees exactly the same issue you are describing, can you include more information:

  • A screen recording or logs that demonstrate the issue.
  • Specific versions or build numbers when you noticed this code was working as expected. Include all software and hardware versions used in testing.
  • Does this reproduce when the app is not attached to Xcode's debugger?

To test this: build and run the app once from Xcode, then either (1) stop the session and manually relaunch the app from the Home Screen/Springboard rather than pressing Run again, or (2) select Debug > Detach from [App Name] in Xcode's menu bar while the app is still running, then reproduce the hang.

If you need to capture logs in that state, use Console.app (connect the device, filter by your app's bundle ID/process name, per Apple's guidance on accessing device console logs) rather than relying on Xcode's debug console, since Xcode's console is a debugging session view and won't be available/attached once you've detached lldb.

Include the updated files and information in your report. Let me know in this thread once completed and I will make sure that report is routed to the correct team.

Thank you,

 Travis

Travis, it's just enough to run the code snippet to see the issue, clearly and immediately even on iPhone simulator running iOS 27 (24A434).

Just tap the search button and then try to deactivate search by pressing the close button, here is requested screen recording:

https://share.icloud.com/photos/03dvDC6bRisUbR2E9Z0XP9DcA

And screenshot:

The debugger is not attached.

The issue does not seem to reproduce on iPadOS 27.

Hello Travis!

You are right, I believe iOS 26 also exhibits a hang. It also seemed to struggle to close the search button properly as the icon would flicker a couple times as it was closed, but it would ultimately prevail. Also of note regarding the differences in iOS 26 and 27, in iOS 26 the search button would always appear as the final item in the toolbar as part of a (visually) separate group, whereas in 27 it is grouped with the rest like a normal toolbar item. The hang in 26 might indicate the underlying bug might actually be present there too, just with different consequences.

I am on iOS 27.0 (24A437) and personally on an iPhone 13 Pro Max, although this behavior is exhibited in both simulators and any device I’ve tried it on (admittedly limited to iPhones) as well as SwiftUI Previews. Unfortunately I did not participate in the betas so I am not sure when the bug was introduced.

I can confirm that it happens without a debugger attached; I have used this search button for the last few months in an app distributed via TestFlight (which of course uses release builds). A version of the app built with the iOS 26 SDK and one on the 27 sdk exhibit the same behavior: on iOS 26, the small hang and nothing more; on iOS 27, utterly broken.

The code was working as expected [ and still is ] in all versions of iOS 26. I have not tried it on any earlier versions.

Additionally, I did notice warnings being printed from UIKit complaining about an internal inconsistency when transitioning between button states. However I wrote this post about 5 minutes before my class began so I haven’t been able to record the messages since. I know this warning being printed is new to iOS 27 as I watch the debug console like a hawk.

Also, while we’ve got the UI frameworks teams’ attention, the view transitions between tabs in a UITabBarController (and thus TabView) are also nonfunctional currently!

I will update with more details when I get home.

iOS 27 regression - minimized search item in top toolbar breaks its state
 
 
Q