I have a dataset(each piece has a string and an int) that I'm breaking into sections in a SwiftUI list. When the user enters the search field, I want to completely change the sections in the list, but animate the list items to the new section. I've done this in UIKit as seen in the first video below.
However, as I'm testing out SwiftUI in iOS14, I notice that when I change between the sets of sections, the items in the list don't move vertically to the new section, but rather animate it left to right with the new section. When used with the large dataset it makes the entire screen look as if it is animating in from the left.
How can we disable the section animation, or change it to behave similarly to the UIKit method. Is there another way to handle this more effectively?
I've included two SwiftUI demos showing animation issues with items in a list moving between sections. In the first one, it "moves" the data from sections 1A and 2A to 1B and 2B.
In the second demo, it adds a section and moves the data into the new section. Doing so with "add", then "update" acts as what I would expect to happen. But when you press "both" it illustrates the other weird animation.
UIKit Version: imgur.com/a/mq5IrE5
Demo Code: textuploader.com/1f6bb
However, as I'm testing out SwiftUI in iOS14, I notice that when I change between the sets of sections, the items in the list don't move vertically to the new section, but rather animate it left to right with the new section. When used with the large dataset it makes the entire screen look as if it is animating in from the left.
How can we disable the section animation, or change it to behave similarly to the UIKit method. Is there another way to handle this more effectively?
I've included two SwiftUI demos showing animation issues with items in a list moving between sections. In the first one, it "moves" the data from sections 1A and 2A to 1B and 2B.
In the second demo, it adds a section and moves the data into the new section. Doing so with "add", then "update" acts as what I would expect to happen. But when you press "both" it illustrates the other weird animation.
UIKit Version: imgur.com/a/mq5IrE5
Demo Code: textuploader.com/1f6bb