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 #777

Closed
NicolasBuquet opened this issue Mar 13, 2023 · 0 comments · Fixed by #798
Closed

Input command should not be auto-corrected #777

NicolasBuquet opened this issue Mar 13, 2023 · 0 comments · Fixed by #798
Assignees
Labels
bug Something isn't working iOS

Comments

@NicolasBuquet
Copy link
Contributor

NicolasBuquet commented Mar 13, 2023

A piece of code in Element auto-correct user input 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()
        }

Although it is usually ok to help user correcting its input, it should not be done when input is a command.

For instance, it makes command /discardsession to be rewritten as /discard session and makes the command not identified.

I propose that command (string beginning with a '/') should not be auto-corrected.

It is a problem on Element side (element-hq/element-ios#7424)

@NicolasBuquet NicolasBuquet added bug Something isn't working iOS labels Mar 13, 2023
@NicolasBuquet NicolasBuquet self-assigned this Mar 13, 2023
@NicolasBuquet NicolasBuquet changed the title Input command should not be auto-corected Input command should not be auto-corrected Mar 29, 2023
@NicolasBuquet NicolasBuquet linked a pull request Mar 29, 2023 that will close this issue
NicolasBuquet added a commit that referenced this issue Apr 3, 2023
…e-auto-corrected

Input command should not be auto-corrected (#777)
NicolasBuquet pushed a commit that referenced this issue Apr 3, 2023
NicolasBuquet added a commit that referenced this issue Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant