SwiftUI list does not scroll using 2-finger swipe on trackpad

I have been testing this simple SwiftUI code: It has a list in ContentView shown below. When a cell of the list is tapped, it pushes a SecondList into the navigation stack.

When this SwiftUI code was run on a real iPad with a trackpad, I used 2-finger swipe to scroll the list up and down. In the Simulator, I enabled "Capture Pointer" to simulate a mouse. The list in the ContentView scrolls smoothly. However, for theSecondList, it freezes randomly and thereafter not responding.

It also failed in a UIKit project, where I replaced a UINavigationView with this ContentView using UIHostingViewController.

It was testing it with iPadOS 14.5 on both Simulator and iPad Pro hardware with Magic Keyboard.

How do I fix this? Is this an OS bug?

Code Block
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
List {
ForEach(0..<30, id: \.self) { index in
NavigationLink(
destination: SecondList(),
label: {
Text(String(index))
})
}
}
}.navigationViewStyle(StackNavigationViewStyle())
}
}
struct SecondList: View {
var body: some View {
List {
ForEach(0..<30, id: \.self) { index in
Text(String(index))
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}

That's not presently supported natively by SwiftUI.

Seems to be a solution here:
https://stackoverflow.com/questions/66137652/swiftui-two-finger-swipe-scroll-gesture
I think that there is a gesture recogniser for 2-finger swipe gesture on trackpad (which is the same as moving the scroll wheel on a mouse). See here near the bottom of the page. It says:

“The UIPanGestureRecognizer recognizes continuous scrolling that originates from devices like the trackpad.”

I believe this gesture is built into scroll views in SwiftUI and we can get it for free as a developer. My point is: the scroll gesture makes the view freeze in the particular situation I’ve mentioned in my very first post. And I suspect it is a bug of SwiftUI.

SwiftUI list does not scroll using 2-finger swipe on trackpad
 
 
Q