Hi everyone!
I've encountered an issue on Mac Catalyst: using the latest inspector
modifier causes abnormal Sidebar and Columns state in NavigationSplitView
.
Sample Code:
struct ContentView: View {
@State private var isPresented = false
var body: some View {
NavigationSplitView {
List {
ForEach(0..<20, id: \.self) { item in
Text("Item \(item)")
}
}
} content: {
List {
ForEach(0..<20, id: \.self) { item in
Text("Item \(item)")
}
}
} detail: {
List {
}
}
.inspector(isPresented: $isPresented) {
Form {
}
}
}
}
Steps to reproduce:
- Xcode 16 beta 7, create a new iOS project
- Paste the code above
- Enable Mac Catalyst
- Run on Mac (macOS 15 beta 9)
- Press Command+N three times to open 3 new windows
- Click the Sidebar Toggle button
- The issue occurs (see screenshot below)
Through testing, I found that as long as the inspector
modifier is attached, the issue occurs.
Also, the problem only appears in the 3rd and subsequent newly opened windows—the first two windows work as expected.
FB20061521