From 02229748465c27c363ff4e913e6ed61d65c471dd Mon Sep 17 00:00:00 2001 From: Nicolas Buquet <> Date: Wed, 29 Mar 2023 17:37:37 +0200 Subject: [PATCH] Input command should not be auto-corrected (#777) --- .../Room/Views/InputToolbar/RoomInputToolbarView.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.swift b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.swift index 045fcc9a4..3f1b80b22 100644 --- a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.swift +++ b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.swift @@ -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)