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

[CIS-1104] Fix message list dismissing in modal when scrolling #1364

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### 🐞 Fixed
- Fix jumps when presenting message popup actions in a modal [#1361](https://github.com/GetStream/stream-chat-swift/issues/1361)
- Fix custom Channel Types not allowing uppercase letters [#1361](https://github.com/GetStream/stream-chat-swift/issues/1361)
- Fix `ChatMessageGalleryView.ImagePreview` not compiling in Obj-c [#1363](https://github.com/GetStream/stream-chat-swift/pull/1363)
- Fix `ChatMessageGalleryView.ImagePreview` not compiling in Obj-C [#1363](https://github.com/GetStream/stream-chat-swift/pull/1363)
- Fix message list dismissing on a modal when scrolling [#1364](https://github.com/GetStream/stream-chat-swift/pull/1364)

# [4.0.0-beta.10](https://github.com/GetStream/stream-chat-swift/releases/tag/4.0.0-beta.10)
_August 11, 2021_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ open class ChatMessageListVC:
UITableViewDelegate,
UITableViewDataSource,
UIGestureRecognizerDelegate,
UIAdaptivePresentationControllerDelegate,
GalleryContentViewDelegate,
GiphyActionContentViewDelegate,
LinkPreviewViewDelegate,
Expand Down Expand Up @@ -119,6 +120,8 @@ open class ChatMessageListVC:
tapOnList.cancelsTouchesInView = false
tapOnList.delegate = self
listView.addGestureRecognizer(tapOnList)

navigationController?.presentationController?.delegate = self

messageComposerVC.setDelegate(self)
messageComposerVC.channelController = channelController
Expand Down Expand Up @@ -271,6 +274,12 @@ open class ChatMessageListVC:
}
setScrollToLatestMessageButton(visible: isScrollToBottomButtonVisible)
}

public func presentationControllerShouldDismiss(_ presentationController: UIPresentationController) -> Bool {
// A workaround is required because we are using an inverted UITableView for the message list.
// More details on the issue: https://github.com/GetStream/stream-chat-swift/issues/1307
!listView.isDragging
}

/// Scrolls to most recent message
open func scrollToMostRecentMessage(animated: Bool = true) {
Expand Down