diff --git a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageListConfig.swift b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageListConfig.swift index d76096c4..d68bd92d 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageListConfig.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageListConfig.swift @@ -136,7 +136,7 @@ public struct MessageDisplayOptions { overlayDateLabelSize: CGFloat = 40, lastInGroupHeaderSize: CGFloat = 0, newMessagesSeparatorSize: CGFloat = 50, - minimumSwipeGestureDistance: CGFloat = 10, + minimumSwipeGestureDistance: CGFloat = 20, currentUserMessageTransition: AnyTransition = .identity, otherUserMessageTransition: AnyTransition = .identity, shouldAnimateReactions: Bool = true, diff --git a/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelSwipeableListItem.swift b/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelSwipeableListItem.swift index b02cca9a..ef70e947 100644 --- a/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelSwipeableListItem.swift +++ b/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelSwipeableListItem.swift @@ -41,6 +41,8 @@ public struct ChatChannelSwipeableListItem Void private var trailingLeftButtonTapped: (ChatChannel) -> Void private var leadingButtonTapped: (ChatChannel) -> Void + + @State private var verticalScrolling = false public init( factory: Factory, @@ -76,7 +78,7 @@ public struct ChatChannelSwipeableListItem abs(value.translation.width) && !verticalScrolling { + verticalScrolling = true + } + if diff == .zero { gestureState = .zero } else { @@ -98,7 +104,8 @@ public struct ChatChannelSwipeableListItem, leftButtonTapped: @escaping (ChatChannel) -> Void, rightButtonTapped: @escaping (ChatChannel) -> Void - ) -> some View { + ) -> TrailingSwipeActionsView { TrailingSwipeActionsView( channel: channel, offsetX: offsetX, @@ -127,7 +127,7 @@ extension ViewFactory { buttonWidth: CGFloat, swipedChannelId: Binding, buttonTapped: (ChatChannel) -> Void - ) -> some View { + ) -> EmptyView { EmptyView() }