Skip to content

TextField, Enter Chinese in android device ,The bottom is cut #20183

Closed

Description

@llearn

Steps to Reproduce

TextField 在Android设备上输入中文,文字底部没有显示完全,iOS则没有这个问题

TextField enters Chinese on Android devices, the bottom of the text is not displayed completely, iOS does not have this problem

import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: new AppBar(
          title: new Text('Flutter Demo Home Page'),
        ),
        body: new Container(
          child: TextField(),
        ),
      ),
    );
  }
}

qq20180803-231912 2x

Logs

Analyzing flutter_app...
No issues found! (ran in 1.2s)
[✓] Flutter (Channel master, v0.5.8-pre.229, on Mac OS X 10.13.6 17G65, locale zh-Hans-CN)
    • Flutter version 0.5.8-pre.229 at /usr/local/flutter
    • Framework revision cacd291c5c (2 hours ago), 2018-08-03 15:13:28 +0200
    • Engine revision 4893b0760d
    • Dart version 2.0.0-dev.69.5.flutter-8bad5c7b29

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
    • Android SDK at /data/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.1
    • ANDROID_HOME = /data/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 26.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.25.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.16.0

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

• No issues found!

Activity

  1. parcool commented on Aug 3, 2018

    @parcool

    I got the same issue. +1

  2. added
    a: text inputEntering text in a text field or keyboard related problems
    frameworkflutter/packages/flutter repository. See also f: labels.
    a: typographyText rendering, possibly libtxt
    on Aug 3, 2018
  3. added this to the milestone on Aug 3, 2018
  4. TeddyRomanos commented on Aug 4, 2018

    @TeddyRomanos

    I got the same issue. +1

  5. TeddyRomanos commented on Aug 5, 2018

    @TeddyRomanos

    This happens for Arabic as well.

  6. leftwing666 commented on Aug 21, 2018

    @leftwing666

    it happens on v8.1

  7. HansMuller commented on Oct 24, 2018

    @HansMuller
    Contributor

    @jason-simmons - are we getting the baseline wrong in this case?

  8. HansMuller commented on Oct 24, 2018

    @HansMuller
    Contributor

    @llearn, @parcool @TeddyRomanos, @leftwing666 - When this failure occurs, what is the device's locale?

  9. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 24, 2018
  10. llearn commented on Oct 25, 2018

    @llearn
    Author

    @HansMuller mine is zh-CN

  11. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 25, 2018
  12. parcool commented on Oct 25, 2018

    @parcool

    Locale.CHINA SIMPLIFIED_CHINESE zh-CN

  13. GaryQian commented on Nov 9, 2018

    @GaryQian
    Contributor

    @llearn I have attempted to reproduce this with the test app you provided on both an emulated and physical Nexus 5X, with locale set to zh_CN and have been unable to reproduce. I have also attempted on a Pixel, Pixel 2 XL, Nexus S, and Nexus 5 all without being able to reproduce. I then tried rolling back to an older version of Flutter dated at Aug 1st, which also failed to reproduce.

    Did you or anyone else have a specific environment/device-API-Flutter combination that reliably reproduces this clipping?

  14. 1 remaining item

  15. GaryQian commented on Nov 12, 2018

    @GaryQian
    Contributor

    I have been able to reproduce. Type Chinese characters on android, and then type multiple flag emojis. Erase the flag emojis, and the box will sometimes clip the characters. This is on a physical android device.

    Update: This repro was not consistent outside of my test env, but I have still managed to come up with something that should fix this for now. Referenced below.

  16. added and removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 19, 2018
  17. GaryQian commented on Nov 19, 2018

    @GaryQian
    Contributor

    Should be fixed by #24265. Waiting for it to land.

  18. zoechi commented on Jan 24, 2019

    @zoechi
    Contributor

    @llearn are you still seeing this?

  19. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 24, 2019
  20. llearn commented on Jan 25, 2019

    @llearn
    Author

    @GaryQian @zoechi This problem has been solved. Thank you.

  21. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 25, 2019
  22. GaryQian commented on Jan 25, 2019

    @GaryQian
    Contributor

    I believe this specific behavior was actually fixed by a patch by @jslavitz

    I am still working on additional fixes to prevent the additional jank we are seeing with multilingual textfields. Strut (#26085) will help resolve this.

  23. llearn commented on Jan 25, 2019

    @llearn
    Author

    ezgif-5-d6ededa3a4fd
    不好意思,这里可能还有一点小问题,中文输入的时候光标位置不对(有点偏上)。
    Sorry, there may be a small problem here. When the Chinese input is wrong, the cursor position is wrong (a bit biased).

  24. reopened this on Jan 25, 2019
  25. github-actions commented on Aug 15, 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.

  26. locked as resolved and limited conversation to collaborators on Aug 15, 2021
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 problemsa: typographyText rendering, possibly libtxtframeworkflutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flight

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions