Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LongPressGesture Gestures conflict #41

Closed
UnrealCherry opened this issue Jul 12, 2020 · 1 comment
Closed

LongPressGesture Gestures conflict #41

UnrealCherry opened this issue Jul 12, 2020 · 1 comment

Comments

@UnrealCherry
Copy link

WaterfallGrid((0..<30), id: .self) { index in
CategoryBook().gesture(LongPressGesture(minimumDuration: 0.5, maximumDistance: 1).onEnded{ v in
self.previewShow = true
})
}

use LongPressGesture can't scroll

@paololeonardi
Copy link
Owner

looks like something related to the ScrollView.
A similar question was asked here: https://stackoverflow.com/questions/62733633/swiftui-tapgesture-and-longpressgesture-in-scrollview-with-tap-indication-not-wo

Try adding a TapGesture recognizer:

WaterfallGrid((0..<30), id: .self) { index in
CategoryBook()
  .onTapGesture {}
  .onLongPressGesture(minimumDuration: 0.5, maximumDistance: 1, perform: {
    self.previewShow = true
  })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants