Skip to content

Text input should replace selected text #21058

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

Closed
Dunoo opened this issue Aug 27, 2018 · 2 comments
Closed

Text input should replace selected text #21058

Dunoo opened this issue Aug 27, 2018 · 2 comments
Labels
a: fidelity Matching the OEM platforms better a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels.

Comments

@Dunoo
Copy link

Dunoo commented Aug 27, 2018

After selecting the whole text with TextSelection(), the text is selected, however, if a key on the keyboard is pressed, it adds the pressed key to the beginning of the text as opposed to deleting it and replacing it with the newly pressed key.

Selecting the text:

manualEditorNode.addListener(() {
      if (manualEditorNode.hasFocus) {
        manualInputController.selection = TextSelection(
            baseOffset: 0, extentOffset: manualInputController.text.length);
      }
    });

Is this expected bahavior?

[√] Flutter (Channel master, v0.7.1-pre.30, on Microsoft Windows [Version 10.0.17134.228], locale en-US)
    • Flutter version 0.7.1-pre.30 at C:\flutter
    • Framework revision 7f0f938de7 (42 minutes ago), 2018-08-27 11:11:14 +0200
    • Engine revision af42b6dc95
    • Dart version 2.1.0-dev.1.0.flutter-ccb16f7282

[√] Android toolchain - develop for Android devices (Android SDK 28.0.1)
    • Android SDK at C:\Users\dany\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    • All Android licenses accepted.

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[√] VS Code, 64-bit edition (version 1.26.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 2.17.1

[√] Connected devices (1 available)
    • Nexus 6P • ENU5T15B12001839 • android-arm64 • Android 8.1.0 (API 27)

• No issues found!
@zoechi zoechi added a: text input Entering text in a text field or keyboard related problems a: fidelity Matching the OEM platforms better labels Aug 27, 2018
@zoechi zoechi added this to the Goals milestone Aug 27, 2018
@jslavitz jslavitz added the engine flutter/engine repository. See also e: labels. label Aug 27, 2018
@zoechi zoechi changed the title TextSelection Behavior Text input should replace selected text Aug 28, 2018
@zoechi
Copy link
Contributor

zoechi commented Aug 28, 2018

Closing as dup of #18853

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: fidelity Matching the OEM platforms better a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels.
Projects
None yet
Development

No branches or pull requests

3 participants