`DisclosureGroup` does not animate `isExpanded` binding update when inside a `List`

Originator:darren.mo
Number:rdar://FB13406194 Date Originated:2023-11-23
Status:Open Resolved:
Product:SwiftUI Product Version:macOS 14.1.1 (23B81)
Classification:Incorrect/Unexpected Behavior Reproducible:Always
 
I have attached a sample project that contains a `List` with a `DisclosureGroup`. Upon expansion or collapse of the `DisclosureGroup`, another view is updated. This update should be animated but it is currently not being animated.

This is only an issue on macOS. iOS correctly animates the update.

Comments

Apple

We examined your provided project and did find the difference between macOS and iOS, and it will be addressed in future. For a workaround, please update your binding to the DisclosureGroup from isExpanded: $isExpanded to isExpanded: $isExpanded.animation(), so that the DisclosureGroup will be forced to update the state with animation, and it will let List/DisclosureGroup on macOS behave as the same as iOS

Also just to be clear - the iOS side also does not animate row sizes, it only animate the text size, so it has the same issue of text ‘jumping’

Me

Thanks for looking into it! Looking forward to the long-term solution.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!