Skip to content

Commit

Permalink
Input command should not be auto-corrected (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Buquet committed Apr 3, 2023
1 parent d7c792f commit 0222974
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ import GBDeviceInfo

extension RoomInputToolbarView {
open override func sendCurrentMessage() {
// Triggers auto-correct if needed.
if self.isFirstResponder {
// Tchap fix : don't autocorrecxt if it is a command (starts with a '/')
// Tchap fix will be removed when Element fix will come via rebase (https://github.com/vector-im/element-ios/pull/7462)
// Triggers auto-correct if needed and if it is not a command.
let isCommand = self.textMessage.hasPrefix("/")
if self.isFirstResponder && !isCommand {
let temp = UITextField(frame: .zero)
temp.isHidden = true
self.addSubview(temp)
Expand Down

0 comments on commit 0222974

Please sign in to comment.