When using a combination of listRowSeparator and listSectionSeparator being hidden, list row separators don't show up when appending items to the end of the list.
Here is a simple sample that reproduces the problem:
import SwiftUI
struct Item: Identifiable {
let id: Int
let text: String
}
struct ContentView: View {
@State var items: [Item] = []
var body: some View {
VStack {
Button {
items.append(Item(id: items.count, text: "\(items.count)"))
} label: {
Text("Append")
}
List {
Section {
ForEach(items) { item in
Text(item.text)
.listRowSeparator(.visible)
.listRowSeparatorTint(Color.red)
}
}
// Comment out this for row separators to work
.listSectionSeparator(.hidden, edges: .all)
}
.listStyle(.plain)
}
}
}
This is happening on iOS 15, only when using plain list style, and only when appending to the end of the list.
Am I doing something wrong, or is there a workaround for this problem?
