Skip to content

Introspecting NavigationStack breaks iOS 26 Search Tab #499

@jenyalebid

Description

@jenyalebid

Description

Setting .introspect on to a NavigationStack breaks the iOS 26 TabView searchable behavior.

In the below example, without Introspecting, when tapped on search tab it performs the expect iOS 26 animation. With introspect it just switches tab while retaining the top search bar.

import SwiftUI

struct SampleExample: View {
    var body: some View {
        TabView {
            Tab("1", systemImage: "1.square") {
                Sample(label: "1")
            }
            Tab("2", systemImage: "1.square") {
                Sample(label: "2")
            }
            Tab(role: .search) {
                Search()
            }
        }
    }
}

struct Search: View {
    @State private var searchText = ""
    
    var body: some View {
        NavigationStack {
            List {
                Text("Search")
            }
            .navigationTitle("Search")
            .searchable(text: $searchText)
        }
        .introspect(.navigationStack, on: .iOS(.v26)) { stack in // Search tab is not working properly with this.
            
        }
    }
}

struct Sample: View {
    var label: String
    
    var body: some View {
        NavigationStack {
            List {
                Text(label)
            }
            .navigationTitle(label)
        }
    }
}

Checklist

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

  1. Remove the .introspect to see correct behavior, and add back (already in sample code) to see the issue.

Version information

1.4.0

Destination operating system

iOS 26.0

Xcode version information

Xcode 26.0.0

Swift Compiler version information

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions