Since NavigationView is now deprecated, I’m trying to update my code to use NavigationStack instead. However, I found that when using NavigationStack, section headers within an overall List view no longer have the collapsing triangle functionality. This used to work for NavigationView, List view, Section headers. Am I missing something? Is there a way to get back the section header collapse triangle within an overall List view when encapsulating within a NavigationStack?
You are correct in that you have to use the new initialisers with the isExpanded
parameter to enable the expansion of sections. However, as of iOS 17 beta 1, this only works for lists with the sidebar style. Having spoken with an Apple engineer, it was agreed that this is not the intended behaviour and all list styles should have expandable sections. I did file a feedback report (FB12277169) so this should be resolved soon.