Skip to content

Commit f8d2068

Browse files
Fixed channel list item swipe gesture collision with native gesture
1 parent adf237a commit f8d2068

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
### 🐞 Fixed
77
- Renaming of a channel in ChannelInfo not persisting extra data
8+
- Channel list item swipe gesture collision with native gesture
89

910
# [4.24.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.24.0)
1011
_November 16, 2022_

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelSwipeableListItem.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public struct ChatChannelSwipeableListItem<Factory: ViewFactory, ChannelListItem
3131

3232
/// minimum horizontal translation value necessary to open the side menu
3333
private let openTriggerValue: CGFloat = 60
34+
/// max horizontal translation value necessary to open the side menu
35+
private let maxTriggerValue: CGFloat = 300
3436
/// An additional value to add to the open menu width. This is useful if the cell has rounded corners.
3537
private let addWidthMargin: CGFloat = 5
3638

@@ -141,6 +143,10 @@ public struct ChatChannelSwipeableListItem<Factory: ViewFactory, ChannelListItem
141143

142144
private func dragChanged(to value: CGFloat) {
143145
let horizontalTranslation = value
146+
147+
if abs(horizontalTranslation) > maxTriggerValue {
148+
return
149+
}
144150

145151
if horizontalTranslation > 0 && openSideLock == nil && !showLeadingSwipeActions {
146152
// prevent swiping to left, if not configured.

0 commit comments

Comments
 (0)