When a NavigationSplitView
's sidebar has a default selected value, the detail's toolbar item disappears when resizing the view from compact to regular size.
@State private var selectedId: String? = "anything"
NavigationSplitView {
List(selection: $selectedId) {
Text("Sidebar")
}
} detail: {
Text("Detail")
.toolbar {
Button("Button") {}
}
}
There is no way to get the toolbar item back, other than reloading the view. I have no idea why this happens.
In my example I have a dummy Text("Sidebar")
without a value, but the problem occurs regardless of its content.
Tested on Simulator iPadOS 18.0, and I've seen this happen in our production app.
@vladimirs Please could you open a bug report, include the code snippet and attach the video demonstrating the issue, and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.