Scroll to Top gesture doesn't work when pressed in Status Bar.

I have created a paging app With SwiftUI TabView with TabViewStyle: PageTabViewStyle. In every page there is an UICollectionView holding a list of rows. Now I have used UIViewControllerRepresentable to show the view inside TabView.

It works okay, but the Scroll to top gesture doesn't work here when pressed in the iPhones StatusBar.

Is it a fault of TabView or I am missing Something?

It may happen because of TabViews Scroll property. In UIKIT Views We needed to disable the scrollToTop property of scrollviews (Other then the desired one) is there any public API's for SwiftUI Views in replacement for setting scrollsToTop property?

It works okay, but the Scroll to top gesture doesn't work here when pressed in the iPhones StatusBar.

StatusBar, do you mean info at top of screen ? Then why would you scroll from there to the top ?

AFAIU, behaviour is normal.

Scroll to top gesture : which gesture do you refer to exactly ?

Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

import SwiftUI

struct ContentView: View {
    var body: some View {
        TabView {
            ForEach(0..<10) { number in
                ListViewInsideControllerRepresentable()    // Scroll To Top doesn't work if its being used.
                //ListView()                                   // Scrolls to top works if it's being used.
                    .ignoresSafeArea(.all)
                    .tag(number)
            }
        }
        .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
    }
}

#Preview {
    ContentView()
}

struct ListView: View {
    var body: some View {
        List {
            Text("ASD1")
            Text("ASD2")
            Text("ASD3")
            Text("ASD4")
            Text("ASD1")
            Text("ASD2")
            Text("ASD3")
            Text("ASD4")
            Text("ASD1")
            Text("ASD2")
            Text("ASD3")
            Text("ASD4")
            Text("ASD1")
            Text("ASD2")
            Text("ASD3")
            Text("ASD4")
            Text("ASD1")
            Text("ASD2")
            Text("ASD3")
            Text("ASD4")
            Text("ASD1")
            Text("ASD2")
            Text("ASD3")
            Text("ASD4")
        }
    }
}

struct ListViewInsideControllerRepresentable: UIViewControllerRepresentable {
    func makeUIViewController(context: Context) -> UIViewController {
        return UIHostingController(rootView: ListView())
    }
    
    func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
        print("Update")
    }
}
Scroll to Top gesture doesn't work when pressed in Status Bar.
 
 
Q