-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
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.