0

I'm trying to reproduce in a way the finder column view, but I'm facing an issue. A scroll conflict occurs when I put a ScrollView or a List inside another ScrollView. The horizontal scroll is lagging when the cursor is over the nested ScrollView.

Here is my simplified code :

struct SplitView: View {
    var body: some View {

            
        ScrollView(.horizontal, showsIndicators: false){

            HSplitView{

                ScrollView(showsIndicators: false) {
                    VStack(alignment: .leading) {
                            ForEach(0..<100) {
                                Text("Row \($0)")
                            }
                    }.frame(minWidth: 200, alignment: .leading)
                }
                ScrollView {
                    VStack(alignment: .leading) {
                            ForEach(0..<100) {
                                Text("Row \($0)")
                            }
                    }.frame(minWidth: 200, alignment: .leading)
                }
                ScrollView {
                    VStack(alignment: .leading) {
                            ForEach(0..<100) {
                                Text("Row \($0)")
                            }
                    }.frame(minWidth: 200, alignment: .leading)
                }

                
            }
        }

            
    }
}

I have the same issue with nested List.

Do you have any idea how I can prevent that? Or any workaround?

burnsi
  • 6,194
  • 13
  • 17
  • 27
  • 1
    What is the objective of putting a scrollview within a scrollview? I cannot imagine a scenario where this is user friendly or not-confusing. What is the exact example of the finder column that you are trying to mimic? – Björn Nov 12 '22 at 01:28
  • The first one is for horizontal scroll and the other one is for vertical. When you use column view in the finder, when you open a folder, it creates a new column next to the parent, and so on. So at some point, you might have to horizontally scroll to have access to all columns. I don't know if it's really clear – Cubitussonis Nov 12 '22 at 10:36

0 Answers0