Repository navigation
Support selecting all text on triple click #63576
Description
Activity
- 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/packagesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capability
on Aug 12, 2020 CC @justinmc
Thanks for pointing this out! I agree Flutter should support this.
Two details I want to call attention to:
- I don't see native Android apps producing this behavior. I tried on a physical Pixel 2 running Android 10. Does anyone see this on Android?
- On native iOS and web, it appears to select the entire paragraph, but not all text.
I noticed this within a few minutes of playing with a flutter app on my iPhone, so I'd say it's a significant issue.
Can't speak for Android but as you say the usual behaviour on iOS is to select the paragraph.
Reacted by Akash Gurava, Gene, Steve Gehrman and Greg PriceI also note that a double tap followed by a drag doesn't replicate the native iOS behaviour. In native apps, this gesture selects a block of text. I've added this as a separate issue: #64550
Reacted by Akash Gurava and Justin McCandless- addedplatform-webWeb applications specificallyWeb applications specifically
on Dec 11, 2020 /cc @mdebbar
- addedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on Dec 17, 2020 Triple click doesn't work as expected on flutter web macOS (select all in element?)
Reacted by Steve Gehrman27 remaining items
I’ll be taking this on as one of my priorities. It depends on a refactor but I am working on it. I’ll post updates here as I progress.
Reacted by Erlend, Delonzek, Marwan Sulaiman, Luca Dillenburg, Dominik Šimoník, Justin McCandless, Matthew Gamble, Viride, Simon Bengtsson, Nazar Kahaniak and 8 moreReacted by Simon Bengtsson, Umit and Hady SalehI’ll be taking this on as one of my priorities. It depends on a refactor but I am working on it. I’ll post updates here as I progress.
Hey, @Renzo-Olivares I would like to hear about your progress so far?
Hey @umitk34 I'm currently working on a proof of concept and design doc and will post it here as soon as it's ready. Thank you for the interest.
Reacted by Umit, Barnabas A Nsoh, Simon Bengtsson, Benjamin Schreck, Clifton Labrum and Beatrice IonascuReacted by Umit, Simon Bengtsson and Beatrice Ionascu@Renzo-Olivares Any update on this?
Hey @djsjr, thanks for your interest in this project. I have a proof of concept PR as well as a design doc here. I'm currently working on some related work #109573 which is building a
GestureRecognizerthat can handle taps and drags for text selection (e.g. double tap to drag, triple tap to drag). Once that is done, I will continue moving this project forward.Reacted by Simon Bengtsson, djsjr, Eugene Pisotsky and Benjamin QuinnHey @djsjr, thanks for your interest in this project. I have a proof of concept PR as well as a design doc here. I'm currently working on some related work #109573 which is building a
GestureRecognizerthat can handle taps and drags for text selection (e.g. double tap to drag, triple tap to drag). Once that is done, I will continue moving this project forward.If double tap/triple tap enabled, there is a delay issue (#110300) which makes user experience awful.
Does Flutter have the plan to polish these basic controls thoroughly according to the desktop usage habits?
It is useless to just bring all the mobile controls to the desktop without making any changes.
Desktop users use mouse frequently, click(double/triple)/scroll events are important.@ngugcx I am working on a new
TapAndDragGestureRecognizer, where that delay is not an issue.Reacted by Eugene PisotskyA solution to this issue
bool _canSelectAll = false; final TextEditingController _controller = TextEditingController(); Timer? _selectAllTimer; void _onTap() { _selectAllTimer?.cancel(); _selectAllTimer = null; if (_controller.selection.isCollapsed) { _canSelectAll = true; _selectAllTimer = Timer(const Duration(milliseconds: 500), () { _canSelectAll = false; }); return; } if (!_canSelectAll) return; final selection = TextSelection( baseOffset: 0, extentOffset: _controller.document.length, ); _controller.selection = selection; _canSelectAll = false; return; } @override Widget build(BuildContext context) { return TextField( onTap: _onTap, ); }
Hi @Renzo-Olivares! Any chance there has been some progress on this? Many thanks!! 🙏
Reacted by Benjamin SchreckSure thing @bionascu!
In terms of just closing this issue "Supporting select all text on triple click" I am currently working on introducing a
ParagraphBoundarysubclass in #116549 that will allow for this behavior. That PR is centered around keyboard actions but the boundary subclass will be reusable. Once that is merged I'll start another PR to add triple tap to select for tap/clicks and that should close this issue.Updates on other touch/mouse text gestures:
As of recent #117502 was merged that added support for double tap/click + drag to select text word by word. It also added support for dragging to move the cursor on mobile platforms.
#101151 is the larger project that aims to make these tap/click gestures overridable. This is still in progress and was waiting on #117502 to get merged.
Reacted by misoshiru12Reacted by djsjr, Simon Bengtsson, Justin McCandless, Beatrice Ionascu and Greg Price@Renzo-Olivares , Hi!
I faced this issue even in the latest release, did it fixed somewhere else?@reza00farjam Hello, it is not fixed in the most recent stable release but it is fixed in master.
Reacted by Reza FarjamThis 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 -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Apr 20, 2023
Use case
On native platforms and browsers using a triple click (with a mouse) on text in a textfield one selects all text in the textfield. Flutter doesn't do this, but rather deselects the selected word.
Proposal
Flutter should support this to match native platforms and browsers.