Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ _August 28, 2023_
- Add XCPrivacy manifest [#2740](https://github.com/GetStream/stream-chat-swift/pull/2740)
- Add digital signature to StreamChatUI XCFramework [#2740](https://github.com/GetStream/stream-chat-swift/pull/2740)
- Apply channel capabilities in UI components [#2747](https://github.com/GetStream/stream-chat-swift/pull/2747)
- Add unread messages floating pill to `ChatChannelVC` when the first unread message is not on screen [#2592](https://github.com/GetStream/stream-chat-swift/pull/2592)
- Feature flagged behind `Components.default.isJumpToUnreadEnabled`

### 🐞 Fixed
- Fix Channel Header View not updating when user info changes [#2742](https://github.com/GetStream/stream-chat-swift/pull/2742)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ open class InputTextView: UITextView, AppearanceProvider {
replace(selectedRange, withText: text)
}

override open func layoutSubviews() {
super.layoutSubviews()
handleTextChange()
scrollToCaretPosition(animated: false)
}

open func textDidChangeProgrammatically() {
delegate?.textViewDidChange?(self)
handleTextChange()
Expand Down Expand Up @@ -193,7 +187,8 @@ open class InputTextView: UITextView, AppearanceProvider {
}
}

private func scrollToCaretPosition(animated: Bool) {
/// Scrolls the text view to to the caret's position.
public func scrollToCaretPosition(animated: Bool) {
guard let selectedTextRange = self.selectedTextRange else { return }
let caret = caretRect(for: selectedTextRange.start)
scrollRectToVisible(caret, animated: animated)
Expand Down
4 changes: 4 additions & 0 deletions Sources/StreamChatUI/Composer/ComposerVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,10 @@ open class ComposerVC: _ViewController,
self.composerView.attachmentButton.isHidden = true
}
}

// Makes sure the text view remains in the same position when it changes size.
composerView.inputMessageView.textView.setTextViewHeight()
composerView.inputMessageView.textView.scrollToCaretPosition(animated: false)
}

@objc open func showAvailableCommands(sender: UIButton) {
Expand Down