Skip to content

Textfield content disapears when text is too long #51257

Open

Description

@renanyoy

http://pub.waves.pw/ms/textfield.mp4

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Linux, locale en_US.UTF-8)
• Flutter version 1.12.13+hotfix.8 at /home/renan/code/flutter
• Framework revision 0b8abb4 (11 days ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced
• Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /home/renan/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• Java binary at: /home/renan/code/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.

[✓] Android Studio (version 3.5)
• Android Studio at /home/renan/code/android-studio
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.42.1)
• VS Code at /usr/share/code
• Flutter extension version 3.8.1

[✓] Connected device (1 available)
• Pixel 3a • 9BCAY1J68Q • android-arm64 • Android 10 (API 29)

• No issues found!

Activity

  1. renanyoy commented on Feb 22, 2020

    @renanyoy
    Author

    constrained one line TexField() using

    Container(height:34,child:TextField(..))
    

    with fontSize:16

  2. added
    a: text inputEntering text in a text field or keyboard related problems
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Feb 23, 2020
  3. jason-simmons commented on Feb 26, 2020

    @jason-simmons
    Member

    @justinmc the behavior in this case changed with 6d8f539. Is this working as intended?

  4. renanyoy commented on Feb 26, 2020

    @renanyoy
    Author

    I was using material TextField, I switched to Cupertino one, and it works.
    But I think 6d8f539 will not fix material TextField

  5. justinmc commented on Feb 28, 2020

    @justinmc
    Contributor

    This is not intended behavior. I'll mark it as a regression.

    I was able to reproduce it with the following code (though it looks cut off instead of totally disappearing):

    cutoff

    import 'package:flutter/material.dart';
    
    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Flutter Demo',
          theme: ThemeData(
            primarySwatch: Colors.blue,
            textSelectionHandleColor: Colors.greenAccent,
          ),
          home: Scaffold(
            body: Center(
              child: Container(
                height: 34,
                child: TextField(
                  maxLines: 1,
                ),
              ),
            ),
          ),
        );
      }
    }
  6. JamesGZM commented on Apr 23, 2020

    @JamesGZM

    I found that it is a height problem. If you set the height to 42, you will not have this problem. How to set the height of the textField?

  7. justinmc commented on Apr 23, 2020

    @justinmc
    Contributor

    This appears to be fixed in the latest master thanks to @Piinks and #55408 🎉

    Let me know if anyone can still see this on master.

    I was too quick in my testing, looks like it still happens on my Pixel 2.

  8. JamesGZM commented on Apr 24, 2020

    @JamesGZM

    I use the stable branch and look forward to pushing it to the stable branch

  9. justinmc commented on May 1, 2020

    @justinmc
    Contributor

    Here's a workaround that seems to fix it for me: use isDense.

              Container(
                height: 34,
                child: TextField(
                  maxLines: 1,
                  decoration: InputDecoration(
                    isDense: true,
                  ),
                ),
              ),

    I spent some time looking into this and couldn't get a fix yet, but I do see that it's affected by the padding used in InputDecorator's _layout.

  10. 50 remaining items

  11. CoderUni commented on Jun 14, 2024

    @CoderUni

    Thanks for your insights @gnprice .

    To make the field shorter without causing this problem, instead of setting a short height, you should adjust the InputDecoration by setting isDense, or contentPadding, or both.

    This issue also occurs without setting a height. Just setting the border to OutlineInputBorder also causes the issue:

    InputDecoration(
      border: const OutlineInputBorder(),
      enabledBorder: OutlineInputBorder(
          borderSide: BorderSide(color: Colors.red),
       ),
    ),
  12. added
    ⏳Bot is counting down the days until it unassigns the issue
    on Oct 17, 2024
  13. flutter-triage-bot commented on Oct 17, 2024

    @flutter-triage-bot

    This issue is assigned to @LongCatIsLooong but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  14. flutter-triage-bot commented on Jan 3, 2025

    @flutter-triage-bot

    This issue was assigned to @LongCatIsLooong but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  15. removed
    ⏳Bot is counting down the days until it unassigns the issue
    on Jan 3, 2025
  16. added and removed
    team-designOwned by Design Languages team
    P2Important issues not at the top of the work list
    on Jan 8, 2025
  17. added
    P2Important issues not at the top of the work list
    on Sep 25, 2025
  18. justinmc commented on Sep 25, 2025

    @justinmc
    Contributor

    We would love to get this issue fixed but no one is currently working on it. If anyone wants to submit a PR I'd be happy to review.

    From @LongCatIsLooong it might be possible to partially workaround this by manually reducing contentPadding, though that might not work if the user has increased their device's font size.

  19. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 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

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowfound in release: 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions