Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectableText background overlays the selection #79168

Closed
nt4f04uNd opened this issue Mar 26, 2021 · 6 comments
Closed

SelectableText background overlays the selection #79168

nt4f04uNd opened this issue Mar 26, 2021 · 6 comments
Labels
a: typography Text rendering, possibly libtxt found in release: 2.0 Found to occur in 2.0 found in release: 2.1 Found to occur in 2.1 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on r: duplicate Issue is closed as a duplicate of an existing issue

Comments

@nt4f04uNd
Copy link
Member

as titled

screenshot

(green - background, red - selection)

image

code sample
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    const title = 'code sample';
    return MaterialApp(
      title: title,
      home: Scaffold(
        backgroundColor: Colors.black,
        body: Home(),
      ),
    );
  }
}

class Home extends StatelessWidget {
  const Home({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: SingleChildScrollView(
        child: Theme(
          data: ThemeData(
            textSelectionTheme: TextSelectionThemeData(selectionColor: Colors.red),
          ),
          child: SelectableText.rich(
            TextSpan(
              children: [
                TextSpan(text: 'wo',
                  style: TextStyle(
                    backgroundColor: Colors.green,
                    fontSize: 400.0,
                  ),
                ),
                TextSpan(text: 'rd',
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 400.0,
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
flutter doctor -v
[√] Flutter (Channel master, 2.1.0-13.0.pre.288, on Microsoft Windows [Version 10.0.19041.867], locale ru-RU)
    • Flutter version 2.1.0-13.0.pre.288 at c:\dev\src\flutter
    • Framework revision e384ca7979 (80 minutes ago), 2021-03-26 17:34:03 +0100
    • Engine revision b5e15d055d
    • Dart version 2.13.0 (build 2.13.0-162.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)    
    • Android SDK at C:\Users\danya\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)   
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.7)       
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30621.155
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 50.0.1
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)   

[√] VS Code (version 1.54.3)
    • VS Code at C:\Users\danya\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.20.0

[√] Connected device (4 available)
    • Redmi Note 5 (mobile) • 40c9f14 • android-arm64  • Android 9 (API 28)
    • Windows (desktop)     • windows • windows-x64    • Microsoft Windows [Version 10.0.19041.867]
    • Chrome (web)          • chrome  • web-javascript • Google Chrome 89.0.4389.90
    • Edge (web)            • edge    • web-javascript • Microsoft Edge 89.0.774.57

• No issues found!
@pedromassangocode pedromassangocode added the in triage Presently being triaged by the triage team label Mar 29, 2021
@pedromassangocode
Copy link

gif

flutter doctor -v
[✓] Flutter (Channel stable, 2.0.3, on macOS 11.2.3 20D91 darwin-x64, locale en-AO)
    • Flutter version 2.0.3 at /Users/pedromassango/Code/flutter_stable
    • Framework revision 4d7946a68d (10 days ago), 2021-03-18 17:24:33 -0700
    • Engine revision 3459eb2436
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/pedromassango/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/pedromassango/Library/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_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • 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-6915495)

[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 54.0.3
    • Dart plugin version 203.7759

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

[✓] Connected device (3 available)
    • iPhone 11 Pro Max (mobile) • 7A82F29E-E49E-4B3C-8609-1570361DBC17 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
    • macOS (desktop)            • macos                                • darwin-x64     • macOS 11.2.3 20D91 darwin-x64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 89.0.4389.90

! Doctor found issues in 1 category.
[✓] Flutter (Channel master, 2.1.0-13.0.pre.294, on macOS 11.2.3 20D91 darwin-x64, locale en-AO)
    • Flutter version 2.1.0-13.0.pre.294 at /Users/pedromassango/Code/flutter_master
    • Framework revision a603714610 (20 hours ago), 2021-03-28 03:54:02 -0700
    • Engine revision b5e15d055d
    • Dart version 2.13.0 (build 2.13.0-162.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/pedromassango/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/pedromassango/Library/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_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • 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-6915495)

[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 54.0.3
    • Dart plugin version 203.7759

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

[✓] Connected device (3 available)
    • iPhone 11 Pro Max (mobile) • 7A82F29E-E49E-4B3C-8609-1570361DBC17 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
    • macOS (desktop)            • macos                                • darwin-x64     • macOS 11.2.3 20D91 darwin-x64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 89.0.4389.90

! Doctor found issues in 1 category.

@pedromassangocode pedromassangocode added a: typography Text rendering, possibly libtxt found in release: 2.0 Found to occur in 2.0 found in release: 2.1 Found to occur in 2.1 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on and removed in triage Presently being triaged by the triage team labels Mar 29, 2021
@nt4f04uNd
Copy link
Member Author

at the beginning of the gif, why can't you select the text with double click? looks like a bug to me

@LongCatIsLooong
Copy link
Contributor

Currently we're only exposing one single paint call from libTxt/SkParagraph which paints the background/decoration, etc., as well as the text. So the painting operation is basically atomic to the framework.

We should be able to fix this after the SkParagraph migration.

@LongCatIsLooong
Copy link
Contributor

Unassigning since this isn't immediately actionable.

@nt4f04uNd
Copy link
Member Author

Closing in favor of #96112

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2022
@nt4f04uNd nt4f04uNd added r: fixed Issue is closed as already fixed in a newer version r: duplicate Issue is closed as a duplicate of an existing issue and removed r: fixed Issue is closed as already fixed in a newer version labels Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: typography Text rendering, possibly libtxt found in release: 2.0 Found to occur in 2.0 found in release: 2.1 Found to occur in 2.1 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on r: duplicate Issue is closed as a duplicate of an existing issue
Projects
None yet
Development

No branches or pull requests

3 participants