Skip to content

SelectionArea supported gestures should have feature parity with TextSelectionGestureDetector #129583

Description

@Renzo-Olivares

SelectionArea should have the same supported gestures as TextSelectionGestureDetector. This is a pre-requisite for migrating TextField from TextSelectionGestureDetector to SelectionArea. Some of these gestures are also needed for re-implementing SelectableText with SelectionArea #104547.

Platform Common:

TextSelectionGestureDetector SelectionArea isEditable/isNonEditable
Double tap to select a word #149295 ✅ Both
Double tap + drag to select word-by-word #149295 ✅ Both
Double click to select a word #124817 ✅ Both
Double click + drag to select word-by-word #124817 ✅ Both
Triple tap to select a paragraph Implementation is there but needs to be enabled. Static text behavior on native platforms have this disabled. Both
Triple tap + drag to select paragraph-by-paragraph Implementation is there but needs to be enabled. Static text behavior on native platforms have this disabled. Both
Triple tap to select all in a single-line input field isEditable
Triple click to select a paragraph #144563 ✅ Both
Triple click + drag to select paragraph-by-paragraph #144563 ✅ Both
Triple click to select all in a single-line input field isEditable
Long press to select word-by-word #132518 ✅ Both
Shift + click to extend selection to clicked position #129583 ✅ Both

Platform Mobile:

TextSelectionGestureDetector SelectionArea isEditable/isNonEditable
On single tap up moves the cursor to the tapped position #132682 ✅ Both

Platform Desktop:

TextSelectionGestureDetector SelectionArea isEditable/isNonEditable
On tap down moves the cursor to the tapped position #132682 ✅ Both

Platform Android:

TextSelectionGestureDetector SelectionArea isEditable/isNonEditable
Drag to move cursor isEditable

Platform iOS:

TextSelectionGestureDetector SelectionArea isEditable/isNonEditable
Select word edge on tap up Both
Drag that begins on cursor moves the cursor isEditable
Long press to move cursor isEditable
Single tap on previous selection should toggle toolbar #13285 ✅ Both

Platform Linux:

TextSelectionGestureDetector SelectionArea isEditable/isNonEditable
Triple tap to select a line #153514 Both
Triple tap + drag to select line-by-line #153514 Both

Other details:
On a windows touch screen device the context menu does not show up until the long press ends in editable/static text contexts. On a long press drag it collapses the cursor at the position when the long press ends (editable text). On a long press hold it selects the word on drag start as well as popping up the selection handles (static text). On a long press drag nothing happens (the word at the long press start is selected) (static text).

Normal touch drag does nothing on static text. Consecutive taps also does nothing on static text / consecutive tap + drag.

On a normal touch drag it acts as a mouse drag (editable text). On Editable text consecutive tap / consecutive tap + drag works.

on tap down/tap up works similar to android for editable text, the selection is set on tap up.

Activity

  1. changed the title [-]`SelectionArea` should have feature parity with `TextSelectionGestureDetector`[/-] [+]`SelectionArea` supported gestures should have feature parity with `TextSelectionGestureDetector`[/+] on Jun 26, 2023
  2. added
    in triagePresently being triaged by the triage team
    a: text inputEntering text in a text field or keyboard related problems
    frameworkflutter/packages/flutter repository. See also f: labels.
    f: gesturesflutter/packages/flutter/gestures repository.
    c: proposalA detailed proposal for a change to Flutter
    f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIs
    and removed
    in triagePresently being triaged by the triage team
    on Jun 27, 2023
  3. added
    P3Issues that are less important to the Flutter project
    on Jun 27, 2023
  4. added
    P1High-priority issues at the top of the work list
    and removed
    P3Issues that are less important to the Flutter project
    on Aug 15, 2023
  5. justinmc commented on Aug 15, 2023

    @justinmc
    Contributor

    Given that there are so many unimplemented gestures on SelectionArea, is work better spent allowing it to share this code with EditableText instead of reimplementing these? Or is it not so simple?

  6. 4 remaining items

  7. added a commit that references this issue on Sep 28, 2023
    21ad712
  8. added a commit that references this issue on Oct 10, 2023
    fe315c9
  9. conformtojesus commented on Jun 18, 2024

    @conformtojesus

    With iOS, Is it possible to combine gestures with SelectionArea, such as long press to select a word, tap to select a sentence/paragraph etc.

  10. moved this from Incoming Issues to In progress in SelectableRegion Improvementson Mar 2, 2026
  11. moved this from In progress to Incoming Issues in SelectableRegion Improvementson Mar 2, 2026
  12. moved this from Incoming Issues to Prioritized in SelectableRegion Improvementson Mar 2, 2026
  13. moved this from Updated to Needs Update in SelectableRegion Improvementson Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1High-priority issues at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: proposalA detailed proposal for a change to Flutterf: gesturesflutter/packages/flutter/gestures repository.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsframeworkflutter/packages/flutter repository. See also f: labels.team-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