mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-05 19:28:46 +02:00
Fixed the bug where tapping the send button while inline text prediction has uncommitted text messes up the message
This commit is contained in:
parent
be6c32ef9c
commit
d3a279a9a2
1 changed files with 4 additions and 0 deletions
|
|
@ -5339,6 +5339,10 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
|||
}
|
||||
|
||||
@objc func sendButtonPressed() {
|
||||
if let textInputNode = self.textInputNode, let textRange = textInputNode.textView.markedTextRange {
|
||||
textInputNode.textView.replace(textRange, withText: "")
|
||||
}
|
||||
|
||||
if let textInputNode = self.textInputNode, let presentationInterfaceState = self.presentationInterfaceState, let editMessage = presentationInterfaceState.interfaceState.editMessage, let inputTextMaxLength = editMessage.inputTextMaxLength {
|
||||
let textCount = Int32(textInputNode.textView.text.count)
|
||||
let remainingCount = inputTextMaxLength - textCount
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue