There seems to be a bug; when scrolling very quickly down a List, and then scrolling up at normal speed, scrolling becomes very janky and jumpy, often skipping one or two rows. This only happens on macOS.
I'm kind of surprised I've seen no one else mention this bug, as I can recreate it in a very simple Xcode Project. I'm wondering if anyone knows of a workaround?
Steps to reproduce:
- Build and launch the code below
- Very quickly scroll all the way down using the scrollbar
- Scroll up at a normal speed, after a few rows it will get janky
Code:
struct MinimalAlbum: Identifiable {
let id: Int
let title: String
}
struct ContentView: View {
private let staticAlbums: [MinimalAlbum] = (0..<1000).map { i in
MinimalAlbum(id: i, title: "Album Title \(i)")
}
var body: some View {
List {
ForEach(staticAlbums) { album in
Text("Album ID: \(album.id) - \(album.title)")
.frame(height: 80) // Fixed height
}
}
}
}