Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input command should not be auto-corrected #7424

Open
NicolasBuquet opened this issue Mar 13, 2023 · 0 comments · May be fixed by #7462
Open

Input command should not be auto-corrected #7424

NicolasBuquet opened this issue Mar 13, 2023 · 0 comments · May be fixed by #7462
Labels
A-Composer O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@NicolasBuquet
Copy link

NicolasBuquet commented Mar 13, 2023

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

@NicolasBuquet NicolasBuquet added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Mar 13, 2023
@Velin92 Velin92 added S-Minor Impairs non-critical functionality or suitable workarounds exist O-Occasional Affects or can be seen by some users regularly or most users rarely labels Mar 20, 2023
@NicolasBuquet NicolasBuquet changed the title Input command should not be auto-corected Input command should not be auto-corrected Mar 29, 2023
NicolasBuquet pushed a commit to NicolasBuquet/element-ios-tchap that referenced this issue Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Composer O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants