mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Bug fixes
This commit is contained in:
@@ -331,6 +331,12 @@ public final class TextFieldComponent: Component {
|
||||
}
|
||||
|
||||
if let attributedString = attributedString {
|
||||
let current = self.inputState
|
||||
let range = NSMakeRange(current.selectionRange.lowerBound, current.selectionRange.count)
|
||||
if !self.chatInputTextNode(shouldChangeTextIn: range, replacementText: attributedString.string) {
|
||||
return false
|
||||
}
|
||||
|
||||
self.updateInputState { current in
|
||||
if let inputText = current.inputText.mutableCopy() as? NSMutableAttributedString {
|
||||
inputText.replaceCharacters(in: NSMakeRange(current.selectionRange.lowerBound, current.selectionRange.count), with: attributedString)
|
||||
|
||||
Reference in New Issue
Block a user