Skip to content

Enter key is not working properly (the cursor is not updated to the newline) in Text Fields #19371

Closed

Description

@sgon00

The flutter is the latest version. I just ran flutter upgrade.

$ flutter doctor
[✓] Flutter (Channel master, v0.5.7-pre.118, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 2.3)

It's hard for me to describe the bug in English so that I uploaded three screenrecords. Both bug01.mp4 and bug02.mp4 are the bug behaviors. expect.mp4 is what I expect in a normal native app.

Basically, when I input words in text fields and press Enter, the cursor is always not updated to the next new line and the cursor is still in the old line. (this is not expected) That will cause some weird observation. When the cursor is still in the old line and I input some words, the new inputs will jump to next line. Something like that.

PS:
Actually, I found this incorrect Enter key behavior 7 months ago and filed a bug in some community app project. I didn't pay too much attention on this bug because I think it's too obvious and everyone should notice it. I thought the bug should be fixed very soon. But I was wrong and after about a year, the most obvious bug is still here.

enterKeyBug.zip

Activity

  1. changed the title [-]Enter key is not working properly (the cursor is always in the wrong position) in Text Fields[/-] [+]Enter key is not working properly (the cursor is not updated to the newline) in Text Fields[/+] on Jul 14, 2018
  2. added
    a: text inputEntering text in a text field or keyboard related problems
    c: regressionIt was better in the past than it is now
    on Jul 14, 2018
  3. jonahwilliams commented on Jul 14, 2018

    @jonahwilliams
    Contributor

    I can reproduce this on iOS but not on Android, might be specific to the iOS text handling

  4. sgon00 commented on Jul 15, 2018

    @sgon00
    Author

    @jonahwilliams Sorry, no. I don't have iOS mobiles at all. I can reproduce this on all different Android mobiles, such as Android 8.1, Android 7.1.1, Android 5.1.1 etc... And the screenrecords I posted are from android 8.1.
    Thanks a lot for the investigation and reply. I hope this bug can be fixed soon since I plan to write a wiki app which will use text fields heavily.

  5. jonahwilliams commented on Jul 15, 2018

    @jonahwilliams
    Contributor

    @sgon00 you're right, I can reproduce this on android devices as well.

  6. jonahwilliams commented on Jul 15, 2018

    @jonahwilliams
    Contributor

    The issue appears to be that TextAffinity is not updated from upstream to downstream when a newline is inserted

  7. zoechi commented on Jul 16, 2018

    @zoechi
    Contributor

    I think this is a dup of #15572
    and I can still reproduce with

    [✓] Flutter (Channel master, v0.5.7-pre.122, on Mac OS X 10.13.5 17F77, locale en-AT)
    • Flutter version 0.5.7-pre.122 at /Users/zoechi/flutter/flutter
    • Framework revision e7832a3 (2 days ago), 2018-07-14 09:32:41 -0700
    • Engine revision c5a63d2
    • Dart version 2.0.0-dev.67.0.flutter-84ca27a09e

    [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /usr/local/opt/android-sdk
    • Android NDK at /usr/local/opt/android-sdk/ndk-bundle
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /usr/local/opt/android-sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

    [✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

    [✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 23.1.2
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

    [✓] IntelliJ IDEA Ultimate Edition (version 2018.1.5)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 26.0.2
    • Dart plugin version 181.4892.1

    [✓] Connected devices (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

    • No issues found!

  8. jonahwilliams commented on Jul 16, 2018

    @jonahwilliams
    Contributor

    Ahh thanks @zoechi , closing this as a dup of #15572

  9. github-actions commented on Sep 2, 2021

    @github-actions

    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.

  10. locked as resolved and limited conversation to collaborators on Sep 2, 2021
  11. added
    CICDRun CI/CD
    and removed
    CICDRun CI/CD
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: text inputEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowplatform-androidAndroid applications specificallyplatform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions