Scrolling up in List after having quickly scrolled down becomes jumpy

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
             }
        }
    }
}

Little update: setting .environment(\.defaultMinListRowHeight, 80) seems to fix the issue for lists with static heights for each row, however, this still makes List pretty much unusable for lists with variable height.

Example:

struct MinimalAlbum: Identifiable {
    let id: Int
    let title: String
    let height: CGFloat
}

struct ContentView: View {
    private let staticAlbums: [MinimalAlbum] = (0..<1000).map { i in
        MinimalAlbum(
            id: i,
            title: "Album Title \(i)",
            height: CGFloat.random(in: 70..<90)
        )
    }
    
    var body: some View {
        List {
            ForEach(staticAlbums) { album in
                HStack {
                    Rectangle()
                        .frame(width: 80, height: album.height)
                        .foregroundColor(.blue)
                    
                    Text("Album ID: \(album.id) - \(album.title)")
                }
             }
        }
    }
}
Scrolling up in List after having quickly scrolled down becomes jumpy
 
 
Q