Skip to content

Text selection handler clips Chinese text #69847

Closed

Description

@voiddog

Screenshot


You can see the text will be cliping.

Steps to Reproduce

It can be reproduce in master.

Code
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      supportedLocales: [
        const Locale.fromSubtags(languageCode: 'zh'),
        const Locale('en', ''),
      ],
      locale: const Locale.fromSubtags(languageCode: 'zh'),
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate
      ],
      title: 'Flutter Demo',
      theme: ThemeData(
        platform: TargetPlatform.iOS,
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 20),
          child: TextField(),
        ),
      ),
    );
  }
}

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.24.0-8.0.pre.87, on Mac OS X 10.15.7 19H2 darwin-x64, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.2.3)
[✓] VS Code (version 1.50.1)
[✓] Connected device (3 available)

! Doctor found issues in 1 category.

Activity

  1. pedromassangocode commented on Nov 5, 2020

    @pedromassangocode

    Reproducible on stable and master channels.

    Cc @justinmc

    Screen Shot 2020-11-05 at 09 03 49

    Screen Shot 2020-11-05 at 09 06 05

    flutter doctor -v (master)
    [✓] Flutter (Channel master, 1.24.0-8.0.pre.94, on Mac OS X 10.15.7 19H2 darwin-x64, locale en)
        • Flutter version 1.24.0-8.0.pre.94 at /Users/pedromassango/dev/SDKs/flutter_master
        • Framework revision 9470a7e864 (2 hours ago), 2020-11-04 21:49:59 -0800
        • Engine revision bf259226b2
        • Dart version 2.12.0 (build 2.12.0-21.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
        • Android SDK at /Users/pedromassango/Library/Android/sdk
        • Platform android-30, build-tools 30.0.1
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 12.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.1, Build version 12A7403
        • CocoaPods version 1.9.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    
    [✓] IntelliJ IDEA Community Edition (version 2020.2.3)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 50.0
        • Dart plugin version 202.7319.5
    
    [✓] VS Code (version 1.50.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.16.0
    
    [✓] Connected device (4 available)
        • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
        • macOS (desktop)             • macos         • darwin-x64     • Mac OS X 10.15.7 19H2 darwin-x64
        • Web Server (web)            • web-server    • web-javascript • Flutter Tools
        • Chrome (web)                • chrome        • web-javascript • Google Chrome 86.0.4240.183
    
    • No issues found!
    
    flutter doctor -v (stable)
    [✓] Flutter (Channel stable, 1.22.3, on Mac OS X 10.15.7 19H2, locale en)
        • Flutter version 1.22.3 at /Users/pedromassango/dev/SDKs/flutter_stable
        • Framework revision 8874f21e79 (6 days ago), 2020-10-29 14:14:35 -0700
        • Engine revision a1440ca392
        • Dart version 2.10.3
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
        • Android SDK at /Users/pedromassango/Library/Android/sdk
        • Platform android-30, build-tools 30.0.1
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 12.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.1, Build version 12A7403
        • CocoaPods version 1.9.3
    
    [!] Android Studio (version 4.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    
    [✓] IntelliJ IDEA Community Edition (version 2020.2.3)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin installed
        • Dart plugin version 202.7319.5
    
    [✓] VS Code (version 1.50.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.16.0
    
    [✓] Connected device (1 available)
        • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
    
    ! Doctor found issues in 1 category.
    
  2. changed the title [-]CupertinoTextSelection will clip chinese text[/-] [+]Cupertino text selection handler will clip Chinese text[/+] on Nov 5, 2020
  3. added
    a: fidelityMatching the OEM platforms better
    a: qualityA truly polished experience
    p: cupertino_uicupertino_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    on Nov 5, 2020
  4. changed the title [-]Cupertino text selection handler will clip Chinese text[/-] [+]Cupertino text selection handler clips Chinese text[/+] on Nov 5, 2020
  5. justinmc commented on Nov 5, 2020

    @justinmc
    Contributor

    I don't reproduce it when I run on an iPhone 11 simulator running iOS 14. What devices are you guys seeing this on?

    Screen Shot 2020-11-05 at 9 38 18 AM

  6. pedromassangocode commented on Nov 6, 2020

    @pedromassangocode

    Sorry I forgot to mention that I used an Android device:
    • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)

    Maybe it is Android specific?

  7. voiddog commented on Nov 6, 2020

    @voiddog
    Author

    @justinmc
    My device is android,HUAWEI P30 pro。

    On your screenshot, the text is also cropped. About 1-2 pixels cropped

  8. voiddog commented on Nov 6, 2020

    @voiddog
    Author

    Here is the difference.

    Current:

    After remove pending:

    There is a difference of about one pixel at the bottom

  9. 16 remaining items

  10. added
    P2Important issues not at the top of the work list
    on Jan 3, 2023
  11. oke331 commented on Aug 22, 2023

    @oke331

    I'm encountering the same issue while using Flutter version 3.13.0 in a Japanese context.
    Could someone guide me on how to resolve this issue?
    please refer to the following comment -> #132819 (comment)

  12. tgucio commented on Sep 22, 2023

    @tgucio
    Contributor

    This should be fixed by #133386.

  13. added
    r: fixedIssue is closed as already fixed in a newer version
    on Sep 22, 2023
  14. github-actions commented on Oct 6, 2023

    @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.

  15. locked as resolved and limited conversation to collaborators on Oct 6, 2023
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: internationalizationSupporting other languages or locales. (aka i18n)a: qualityA truly polished experiencea: 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.7frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions