2

I have a List and want to make list items respond to long press gesture. But after adding the gesture to list item, I can not scroll the list from the text area.

List {
  ForEach(items) { item in
    Text(item.name)
      .onLongPressGesture { print("long press") }
  }
}
Runjuu
  • 43
  • 5

1 Answers1

0

maybe you should publish more code....

I just tested it with 13.2 ...with this code -> works

struct ContentView: View {
    var body: some View {
        List {
            ForEach(UIFont.familyNames, id: \.self) { item in
            Text(item)
              .onLongPressGesture { print("long press") }
          }
        }
    }
}
Chris
  • 7,579
  • 3
  • 18
  • 38