mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 20:39:24 +00:00
Convert the timeline's long press gesture recogniser to UIKit and prevent scroll view conflicts
This commit is contained in:
committed by
Stefan Ceriu
parent
b984c794fc
commit
ba031c8472
@@ -54,7 +54,7 @@ struct SwipeRightAction<Label: View>: ViewModifier {
|
||||
content
|
||||
.offset(x: xOffset, y: 0.0)
|
||||
.animation(.interactiveSpring().speed(0.5), value: xOffset)
|
||||
.gesture(PanGesture { gesture in
|
||||
.gesture(PanGestureRepresentable { gesture in
|
||||
switch gesture.state {
|
||||
case .ended, .cancelled, .failed:
|
||||
if xOffset > actionThreshold {
|
||||
@@ -204,7 +204,7 @@ struct SwipeRightAction_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
// Fixes the issue on iOS 18 where DragGesture conflicts with the scroll view
|
||||
// https://github.com/feedback-assistant/reports/issues/542#issuecomment-2581322968
|
||||
private struct PanGesture: UIGestureRecognizerRepresentable {
|
||||
private struct PanGestureRepresentable: UIGestureRecognizerRepresentable {
|
||||
var handle: (UIPanGestureRecognizer) -> Void
|
||||
|
||||
func makeCoordinator(converter: CoordinateSpaceConverter) -> Coordinator { .init() }
|
||||
|
||||
Reference in New Issue
Block a user