-
Notifications
You must be signed in to change notification settings - Fork 27.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SelectionArea
supported gestures should have feature parity with TextSelectionGestureDetector
#129583
SelectionArea
supported gestures should have feature parity with TextSelectionGestureDetector
#129583
Comments
SelectionArea
should have feature parity with TextSelectionGestureDetector
SelectionArea
supported gestures should have feature parity with TextSelectionGestureDetector
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? |
Talked offline with @justinmc and agreed to keep a look out for opportunities where we can re-use logic from |
This change collapses the selection at the clicked/tapped location on single click down for desktop platforms, and on single click/tap up for mobile platforms to match native. This is a change from how `SelectionArea` previously worked. Before this change a single click down would clear the selection. From observing a native browser it looks like when tapping on static text the selection is not cleared but collapsed. A user can still attain the selection from static text using the `window.getSelection` API. https://jsfiddle.net/juepasn3/11/ You can try this demo out here to observe this behavior yourself. When clicking on static text the selection will change. This change also allows `Paragraph.selections` to return selections that are collapsed. This for testing purposes to confirm where the selection has been collapsed. Partially fixes: #129583
This change collapses the selection at the clicked/tapped location on single click down for desktop platforms, and on single click/tap up for mobile platforms to match native. This is a change from how `SelectionArea` previously worked. Before this change a single click down would clear the selection. From observing a native browser it looks like when tapping on static text the selection is not cleared but collapsed. A user can still attain the selection from static text using the `window.getSelection` API. https://jsfiddle.net/juepasn3/11/ You can try this demo out here to observe this behavior yourself. When clicking on static text the selection will change. This change also allows `Paragraph.selections` to return selections that are collapsed. This for testing purposes to confirm where the selection has been collapsed. Partially fixes: flutter#129583
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. |
… platforms (#149295) This change enables double tap / triple tap support in SelectionArea for mobile platforms: Android / Fuchsia: - On native, these platforms allow for double tap / double tap drag to select word-by-word. - On web using touch, these platforms only support double tap to select word. - On web and native using a mouse, these platforms support double click / double click drag to select word-by-word, and triple click / triple click drag to select paragraph-by-paragraph. iOS: - On native, these platforms allow for double tap / double tap drag to select word-by-word. - On web using touch, these platforms do not support double tap/triple tap gestures. - On web using touch, these platforms allow support double tap drag gestures. - On web and native using a mouse, these platforms support double click / double click drag to select word-by-word, and triple click / triple click drag to select paragraph-by-paragraph. Part of: #129583
… platforms (flutter#149295) This change enables double tap / triple tap support in SelectionArea for mobile platforms: Android / Fuchsia: - On native, these platforms allow for double tap / double tap drag to select word-by-word. - On web using touch, these platforms only support double tap to select word. - On web and native using a mouse, these platforms support double click / double click drag to select word-by-word, and triple click / triple click drag to select paragraph-by-paragraph. iOS: - On native, these platforms allow for double tap / double tap drag to select word-by-word. - On web using touch, these platforms do not support double tap/triple tap gestures. - On web using touch, these platforms allow support double tap drag gestures. - On web and native using a mouse, these platforms support double click / double click drag to select word-by-word, and triple click / triple click drag to select paragraph-by-paragraph. Part of: flutter#129583
…lutter#148574) Shift Click to move the selection end edge on desktop platforms. This is consistent with native Linux and Windows. On macOS the behavior moves the selection edge closest to the tapped position (will implement in a later PR). Part of: flutter#129583
…lutter#148574) Shift Click to move the selection end edge on desktop platforms. This is consistent with native Linux and Windows. On macOS the behavior moves the selection edge closest to the tapped position (will implement in a later PR). Part of: flutter#129583
SelectionArea
should have the same supported gestures asTextSelectionGestureDetector
. This is a pre-requisite for migratingTextField
fromTextSelectionGestureDetector
toSelectionArea
. Some of these gestures are also needed for re-implementingSelectableText
withSelectionArea
#104547.Platform Common:
Platform Mobile:
Platform Desktop:
Platform Android:
Platform iOS:
Platform Linux:
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.
The text was updated successfully, but these errors were encountered: