Skip to content

[web] SelectableText doesn't show toolbar #44176

Open

Description

@OGSUG

Problem

Flutter 1.10.14 • channel dev

  • flutter for web
    Want to copy String_data in the flutter for web.

  • clipboard
    When trying clipboard in the flutter web , cant copy the text.

import 'package:flutter/services.dart';


Clipboard.setData(ClipboardData(text: 'data'));
  • SelectableText
    When tap it, do not appear toolbar.
SelectableText(
          'SelectableText',
          showCursor: true,
          enableInteractiveSelection: true,
          toolbarOptions: ToolbarOptions(copy: true),
          style: TextStyle(height: 2),
        ),

Activity

  1. iapicca commented on Nov 5, 2019

    @iapicca

    Hi @OGSUG
    I'm not 100% sure of my next statement,
    but I believe that now there's SelectableText in place of Clipboard,
    or I might have misunderstood your issue.
    Regardless, it would be helpful if you could provide your flutter doctor -v
    and a self contained app on github or the steps to reproduce it.
    Thank you

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 5, 2019
  3. OGSUG commented on Nov 6, 2019

    @OGSUG
    Author

    Hi, @iapicca
    I tried the selectableText , but iam trying flutter for web and there is no tooltip when i tap selectableText..
    flutter-version :Flutter 1.10.14 • channel dev

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 6, 2019
  5. iapicca commented on Nov 6, 2019

    @iapicca

    Hi again @OGSUG

    I believe you are right,
    the cursor shows only once and the "copy" toolbar doesn't show

    code
    import "package:flutter/material.dart";
    
    void main() => runApp(MaterialApp(home: MyApp(),),);
    
    class MyApp extends StatelessWidget {
    
    static const String _lorenIpsum = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis orci vel tempor dignissim. Praesent nisl neque, iaculis et euismod ut, dignissim non arcu. In vel convallis mauris, a viverra turpis. Curabitur ac erat pulvinar, mattis nisl eu, placerat risus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis cursus, nisi eu molestie vulputate, libero tellus convallis purus, id cursus sapien orci at velit. Duis placerat et massa et molestie. Quisque id elit blandit, tempor nulla non, faucibus ex. Pellentesque elementum cursus neque, vitae ultricies massa molestie nec. Morbi a eros finibus, sagittis mi eget, gravida.';
    
    @override
      Widget build(BuildContext context) => Scaffold(
        body: Center(
          child:SelectableText(
            _lorenIpsum,
            showCursor: true,
            toolbarOptions: ToolbarOptions(
              copy: true,
            ),
            style: TextStyle(
            fontSize: 16,
            height: 2,
          ),),
      ),);
    }
    
    doctor
    [√] Flutter (Channel dev, v1.10.14, on Microsoft Windows [Version 10.0.18362.10024], locale en-US)
        • Flutter version 1.10.14 at C:\src\flutter
        • Framework revision 1946fc4da0 (4 weeks ago), 2019-10-07 15:23:31 -0700
        • Engine revision 1d62160fdb
        • Dart version 2.6.0 (build 2.6.0-dev.5.0 d6c6d12ebf)
    
    
    [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
        • Android SDK at C:\Users\iapic\AppData\Local\Android\sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-28, build-tools 28.0.3
        • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web
        • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
    
    [√] Android Studio (version 3.5)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin version 40.0.2
        • Dart plugin version 191.8423
        • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    
    [√] VS Code, 64-bit edition (version 1.39.2)
        • VS Code at C:\Program Files\Microsoft VS Code
        • Flutter extension version 3.6.0
    
    [√] Connected device (3 available)
        • Pixel 3a        • 965AY0WP5C      • android-arm64  • Android 10 (API 29)
        • Chrome          • chrome          • web-javascript • Google Chrome 78.0.3904.87
        • Headless Server • headless-server • web-javascript • Flutter Tools
    
    • No issues found!
    
  6. changed the title [-]clipboard in flutter web[/-] [+][web] SelectableText - showCursor and ToolbarOptions behavior [/+] on Nov 6, 2019
  7. added
    a: qualityA truly polished experience
    a: typographyText rendering, possibly libtxt
    p: material_uimaterial_ui package in flutter/packages
    platform-webWeb applications specifically
    on Nov 6, 2019
  8. added this to the milestone on Nov 7, 2019
  9. deckerst commented on Nov 22, 2019

    @deckerst

    Still an issue in Flutter v1.12.7.

    By the way, does the team intend to handle the usual shortcuts ctrl-c / ctrl-a... as an alternative to the toolbar, when on desktop/web? Or should we wrap the component in a RawKeyboardListener to achieve it?

  10. abrshdir commented on Apr 12, 2020

    @abrshdir

    Flutter please include a share button or custom ToolbarOptions on SelectableText. Please sincerely.

  11. added
    P1High-priority issues at the top of the work list
    on May 29, 2020
  12. removed this from the milestone on Jun 1, 2020
  13. 11 remaining items

  14. removed this from the milestone on Jul 22, 2020
  15. removed this from the milestone on Aug 17, 2020
  16. huycozy commented on Nov 8, 2022

    @huycozy
    Member

    I tested on the latest stable and master channels. This issue seems to be fixed on Android browser but it doesn't have proper behavior on iOS browser.

    • Android browser: ✅
    • iOS browser: ❌

    ✅: No Issue ❌: Issue reproduced

    Android iOS
    RPReplay_Final1667905222.MP4
    flutter doctor -v (stable and master)
    [✓] Flutter (Channel stable, 3.3.7, on macOS 13.0 22A380 darwin-x64, locale en-VN)
        • Flutter version 3.3.7 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision e99c9c7cd9 (27 hours ago), 2022-11-01 16:59:00 -0700
        • Engine revision 857bd6b74c
        • Dart version 2.18.4
        • DevTools version 2.15.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-33, build-tools 31.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
        • Xcode at /Applications/Xcode14.0.1.app/Contents/Developer
        • Build 14A400
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.3)
        • 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 11.0.13+0-b1751.21-8125866)
    
    [✓] IntelliJ IDEA Community Edition (version 2022.2.2)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 70.0.5
        • Dart plugin version 222.4167.21
    
    [✓] VS Code (version 1.72.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.50.0
    
    [✓] Connected device (3 available)
        • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 12 (API 31)
        • macOS (desktop)  • macos       • darwin-x64     • macOS 13.0 22A380 darwin-x64
        • Chrome (web)     • chrome      • web-javascript • Google Chrome 107.0.5304.87
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
    [!] Flutter (Channel master, 3.5.0-12.0.pre.168, on macOS 13.0 22A380 darwin-x64, locale en-VN)
        • Flutter version 3.5.0-12.0.pre.168 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision a1432a9c5d (39 minutes ago), 2022-11-07 19:17:03 -0600
        • Engine revision e7d7edab98
        • Dart version 2.19.0 (build 2.19.0-374.0.dev)
        • DevTools version 2.19.0
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-33, build-tools 31.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14A400
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.3)
        • 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 11.0.13+0-b1751.21-8125866)
    
    [✓] IntelliJ IDEA Community Edition (version 2022.2.2)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 70.0.5
        • Dart plugin version 222.4167.21
    
    [✓] IntelliJ IDEA Community Edition (version 2022.1.1)
        • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
        • 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
    
    [✓] VS Code (version 1.73.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.52.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 13.0 22A380 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 107.0.5304.87
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    

    Updating the labels for further investigation.

  17. 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: qualityA truly polished experiencea: typographyText rendering, possibly libtxtfound in release: 3.3Found to occur in 3.3found in release: 3.5Found to occur in 3.5has 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.platform-iosiOS applications specificallyplatform-webWeb applications specificallyteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions