Repository navigation
Selection toolbar/handler should disappear when it is opened and user clicks outside of it #72029
Description
Activity
- changed the title
[-][mobile_web] Selection toolbar/handler should disappear when it is opened and user clicks outside of it[/-][+]Selection toolbar/handler should disappear when it is opened and user clicks outside of it[/+]on Dec 9, 2020 Hi @pedromassango
I can reproduce on bothstable&master, when using Gmail or Google App, it works as stated in material design guidelinesmultiple flutter doctor -v
[✓] Flutter (Channel stable, 1.22.4, on Microsoft Windows [Version 10.0.19042.630], locale en-US) • Flutter version 1.22.4 at C:\Code\flutter_stable • Framework revision 1aafb3a8b9 (4 weeks ago), 2020-11-13 09:59:28 -0800 • Engine revision 2c956a31c0 • Dart version 2.10.4 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at C:\Code\sdk • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = C:\Code\sdk • Java binary at: C:\Code\android-studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [!] Android Studio (version 4.1.0) • Android Studio at C:\Code\android-studio ✗ 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-b01) [✓] VS Code (version 1.51.1) • VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.17.0 [✓] Connected device (1 available) • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) ! Doctor found issues in 1 category.[✓] Flutter (Channel master, 1.25.0-5.0.pre.141, on Microsoft Windows [Version 10.0.19042.630], locale en-US) • Flutter version 1.25.0-5.0.pre.141 at C:\Code\flutter_master • Framework revision 36bed2b4c3 (8 hours ago), 2020-12-09 20:13:04 -0500 • Engine revision 8518a5bbe6 • Dart version 2.12.0 (build 2.12.0-135.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at C:\Code\sdk • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = C:\Code\sdk • Java binary at: C:\Code\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.8.2) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community • Visual Studio Community 2019 version 16.8.30717.126 • Windows 10 SDK version 10.0.18362.0 [✓] Android Studio (version 4.1.0) • Android Studio at C:\Code\android-studio • 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-b01) [✓] IntelliJ IDEA Community Edition (version 2020.3) • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.2.4 • Flutter plugin version 52.0.5 • Dart plugin version 203.5981.152 [✓] VS Code (version 1.51.1) • VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.17.0 [✓] Connected device (4 available) • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.630] • Chrome (web) • chrome • web-javascript • Google Chrome 87.0.4280.88 • Edge (web) • edge • web-javascript • Microsoft Edge 87.0.664.57 • No issues found!- addeda: fidelityMatching the OEM platforms betterMatching the OEM platforms bettera: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesfound in release: 1.22Found to occur in 1.22Found to occur in 1.22found in release: 1.25Found to occur in 1.25Found to occur in 1.25frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work on
on Dec 10, 2020 CC @justinmc
I am planning to unblock fixes for text editing inconsistencies like this through an upcoming refactor of EditableText (design doc, first PR).
There are lots of small problems like this, and fixing them in the current codebase is like whack-a-mole because the code and state that defines this behavior is so spread out among many widgets. That refactor will hopefully give us a single, simple place to define platform-specific behaviors like this.
That means a fix could be a long ways away. In the meantime, if anyone wants to try fixing this in the current code, you're welcome to have a shot at it.
This is also a problem on Desktop (tracked in #74255).
I did not specifically address this in #82575, but it is worth verifying if the behavior is any better after that change
I did not specifically address this in #82575, but it is worth verifying if the behavior is any better after that change
I still can reproduce this issue on latest master channel.
[✓] Flutter (Channel master, 2.3.0-17.0.pre.299, on macOS 11.4 20F71 darwin-arm, locale en-AO) • Flutter version 2.3.0-17.0.pre.299 at /Users/pedromassango/dev/sdk/flutter_master • Upstream repository https://github.com/flutter/flutter.git • Framework revision db528a24a3 (22 minutes ago), 2021-06-10 11:52:42 -0400 • Engine revision 6e03bbd42c • Dart version 2.14.0 (build 2.14.0-196.0.dev)Ahh, yeah I disabled the feature entirely on mobile: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/routes.dart#L2056
Try changing that line to
falseand checking the behavior14 remaining items
- removedtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
on Jul 18, 2023 - removedtriaged-frameworkTriaged by Framework teamTriaged by Framework team
on Sep 21, 2023 This issue is missing a priority label. Please set a priority label when adding the
triaged-frameworklabel.- addedP2Important issues not at the top of the work listImportant issues not at the top of the work listtriaged-frameworkTriaged by Framework teamTriaged by Framework team
on Sep 26, 2023 @justinmc any chance we could "simply" focus the selected text and then when you tap outside we remove the focus & selection?
We have a usecase where wwe wrap the whole app in a
SelectionArea, not sure that approach would for in this case tho as all text selection share the same widget.Please check this issue: #186575
- addedpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.and removedframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
on Aug 17, 2026 - addedteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamand removedteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
on Aug 26, 2026
Steps to Reproduce - Issue /1
Expected results: The selection toolbar/handler should disappear.
Actual results: Selection toolbar/handler is still visible and the only way to remove it is to select one of the options in the toolbar.
Note: while reproducing you can notice some unwanted behavior: double tap select text but not show selection toolbar. Let's focus on the actual issue.
Side Note - issue /2
About the selection toolbar not disappearing reproduces on

stableand onmasterchannel. The toolbar not disappearing on mobile apps does not follow the Material Design rules: https://material.io/design/platform-guidance/android-text-selection-toolbar.html which says:Expected results: The selection toolbar should disappear.
Actual results: Selection toolbar is still visible and the only way to remove it is to select one of the options in the toolbar.
Flutter Code
flutter doctor -v
It is kinda two issues into one but maybe it is fine since they may be solved in the same PR.
Cc @justinmc @chunhtai