-
Notifications
You must be signed in to change notification settings - Fork 528
Open
Labels
A-ComposerO-OccasionalAffects or can be seen by some users regularly or most users rarelyAffects or can be seen by some users regularly or most users rarelyS-MinorImpairs non-critical functionality or suitable workarounds existImpairs non-critical functionality or suitable workarounds existT-DefectSomething isn't working: bugs, crashes, hangs and other reported problemsSomething isn't working: bugs, crashes, hangs and other reported problems
Description
Steps to reproduce
I try to send command /discardsession
Outcome
What did you expect?
I expect the input to be identified as command discardsession
.
What happened instead?
Because of the auto-correction feature, the command is rewritten as /discard session
.
The piece of code repsonsible of this auto-correction is in Riot/modules/Room/Views/InputToolbar/RoomInputToolbarView.swift:sendCurrentMessage() :
// Triggers auto-correct if needed.
if self.isFirstResponder {
let temp = UITextField(frame: .zero)
temp.isHidden = true
self.addSubview(temp)
temp.becomeFirstResponder()
self.becomeFirstResponder()
temp.removeFromSuperview()
}
I propose that command (string beginning with a '/') should not be auto-corrected.
The code should be:
// 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)
temp.becomeFirstResponder()
self.becomeFirstResponder()
temp.removeFromSuperview()
}
Your phone model
iPhone 14 Simulator
Operating system version
iOS 16
Application version
Element 1.10.3
Homeserver
No response
Will you send logs?
No
Metadata
Metadata
Assignees
Labels
A-ComposerO-OccasionalAffects or can be seen by some users regularly or most users rarelyAffects or can be seen by some users regularly or most users rarelyS-MinorImpairs non-critical functionality or suitable workarounds existImpairs non-critical functionality or suitable workarounds existT-DefectSomething isn't working: bugs, crashes, hangs and other reported problemsSomething isn't working: bugs, crashes, hangs and other reported problems