I'm having an issue with the Sidebar in a SwiftUI macOS app. When the app is first launched, without focus, there is an extra top padding in the sidebar, which gets collapsed to the correct size, when the window gets focus. This seems like a bug to me. Any way to fix this, or am I doing something wrong?
Before (No Focus)
After (Focus)
As you can see, the space between "Inbox" and the three traffic light dots are different in these two cases.
Code
Here is the code for the sidebar:
NavigationView {
List {
Text("Inbox")
Section(header: Text("All projects")) {
ForEachStore(
self.store.scope(state: { $0.projects }, action: AppAction.project(id:action:)), content: { projectStore in
WithViewStore(projectStore) { projectViewStore in
NavigationLink(
destination: ProjectView(store: projectStore),
label: {
Text(projectViewStore.title)
})
}
}
)
Spacer()
}
}.frame(minWidth: 160)
.listStyle(SidebarListStyle())
HStack {
HStack {
Button("−") { viewStore.send(.decrementButtonTapped) }
Text("\(viewStore.count)")
Button("+") { viewStore.send(.incrementButtonTapped) }
}
}
}


