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

ChatSuggestionVC is getting redisplayed and commands shortcut not working #3215

Merged
merged 9 commits into from
May 21, 2024
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### ✅ Added
- Add a new state layer with async-await and observable state objects ([learn more](https://getstream.io/chat/docs/sdk/ios/state-layer/state-layer-overview/)) [#3177](https://github.com/GetStream/stream-chat-swift/pull/3177)

## StreamChatUI
### 🐞 Fixed
- Do not re-displaying suggestion view on each character change [#3215](https://github.com/GetStream/stream-chat-swift/pull/3215)
- Reduce suggestion view height updates while scrolling it [#3215](https://github.com/GetStream/stream-chat-swift/pull/3215)

# [4.55.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.55.0)
_May 13, 2024_

Expand Down
3 changes: 2 additions & 1 deletion Sources/StreamChatUI/Composer/ComposerVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ open class ComposerVC: _ViewController,
updateCommandSuggestions()
updateMentionSuggestions()
updatePlaceholderLabel()
dismissSuggestions()
}

open func updateText() {
Expand Down Expand Up @@ -710,6 +709,8 @@ open class ComposerVC: _ViewController,
self?.showMentionSuggestions(for: typingMention, mentionRange: mentionRange)
}
return
laevandus marked this conversation as resolved.
Show resolved Hide resolved
} else {
dismissSuggestions()
laevandus marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ open class ChatSuggestionsVC: _ViewController,
options: [.new],
changeHandler: { [weak self] collectionView, change in
guard let self = self, let newSize = change.newValue else { return }
guard !collectionView.isTrackingOrDecelerating else { return }
nuno-vieira marked this conversation as resolved.
Show resolved Hide resolved

// NOTE: The defaultRowHeight height value will be used only once to set visibleCells
// once again, not looping it to 0 value so this controller can resize again.
let cellHeight = collectionView.visibleCells.first?.bounds.height ?? self.defaultRowHeight

let newHeight = min(newSize.height, cellHeight * self.numberOfVisibleRows)
guard self.heightConstraints.constant != newHeight else { return }
self.heightConstraints.constant = newHeight
}
)
Expand Down
Loading