Skip to content

TextField and TextFormField could not clear all the text in some situation #25199

@hjliu0206

Description

@hjliu0206

Hello, recently I encountered an problem, when I used the widget TextField and TextFormField, when I delete the characters which I typed and leave one character, then I found I could not delete the last character, below is the recurrent steps

Steps to Reproduce

  1. first let's new an TextField like this(below is the code)
new TextField(
        textAlign: TextAlign.right,
        style: new TextStyle(color: ColorCustom.common_item_content_normal, fontSize: 16.0,),
        controller: controller, 
        keyboardType: TextInputType.phone,
        decoration: new InputDecoration(
          border: InputBorder.none,
          icon: new Text("$title",style: new TextStyle(color: ColorCustom.color41, fontSize: 16.0),),
          hintStyle: new TextStyle(color: ColorCustom.common_item_content_no_edit, fontSize: 16.0),
          hintText: hint, 
        ),
      ),),
    );
  1. above are an input box when running an app, then i type some number or other character,
    below is example: 1333333444444444484

  2. and i put my cursor after 8, and before the last number 4(like this: 133333344444444448|4), then i began to type backspace to delete the number, until the last character '4' is remained

  3. now i found i could not delete the character '4' anymore

running flutter doctor -v

C:\software\flutter\bin>flutter doctor -v
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.407], locale zh-CN)
    • Flutter version 1.0.0 at C:\software\flutter
    • Framework revision 5391447fae (11 days ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

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

[√] Android Studio (version 3.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 30.0.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[!] IntelliJ IDEA Ultimate Edition (version 2017.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.3
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[√] Connected device (1 available)
    • PRO 6 • 80MBCNQ222N9 • android-arm64 • Android 7.1.1 (API 25)

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

Labels

a: text inputEntering text in a text field or keyboard related problemsframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions