We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3362e3e commit 015b4b8Copy full SHA for 015b4b8
Sources/StreamChatSwiftUI/ChatChannel/Composer/MessageComposerViewModel.swift
@@ -96,7 +96,12 @@ public class MessageComposerViewModel: ObservableObject {
96
didSet {
97
if oldValue?.id != composerCommand?.id &&
98
composerCommand?.displayInfo?.isInstant == true {
99
- text = ""
+ // This is needed because of autocompleting text from the keyboard.
100
+ // The update of the text is done in the next cycle, so it overrides
101
+ // the setting of this value to empty string.
102
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) { [weak self] in
103
+ self?.text = ""
104
+ }
105
}
106
if oldValue != nil && composerCommand == nil {
107
pickerTypeState = .expanded(.none)
0 commit comments