-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Implement SelectionArea single click/tap gestures #132682
Implement SelectionArea single click/tap gestures #132682
Conversation
46d4aea
to
f9baf31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for fixing this!
@@ -978,7 +978,7 @@ void main() { | |||
granularity: TextGranularity.word, | |||
), | |||
); | |||
expect(paragraph.selections.length, 0); // how []are you | |||
expect(paragraph.selections.length, 1); // how []are you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a check that the selection is collapsed in the expected location?
expect(paragraph.selections[0], const TextSelection(baseOffset: 2, extentOffset: 1)); | ||
|
||
// Start a new drag. | ||
await gesture.up(); | ||
await gesture.down(textOffsetToPosition(paragraph, 5)); | ||
await tester.pumpAndSettle(); | ||
expect(paragraph.selections.isEmpty, isTrue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe check the selection is collapsed at the right place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left two comments where I'm wondering if the behavior is based on platform, or mouse vs. tap. Can you try plugging a physical mouse into a phone to confirm? If you don't already know the answer.
Otherwise looks good!
case TargetPlatform.android: | ||
case TargetPlatform.fuchsia: | ||
case TargetPlatform.iOS: | ||
// On mobile platforms the selection is set on tap up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really a platform thing or is it a mouse vs. tap thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is a platform thing it seems like. I tried my iPad with the trackpad and keyboard and it doesn't set the selection until tap up. I also tried this on my pixel 7 with a mouse with the same results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, thank you for checking!
/// * [_clearSelection], which clear the ongoing selection. | ||
/// * [_selectWordAt], which selects a whole word at the location. | ||
/// * [selectAll], which selects the entire content. | ||
void _selectPositionAt({required Offset offset}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: The name sounds to me like it will not result in a collapsed selection. Maybe collapseSelectionAt or something like that?
void _handleMouseTapUp(TapDragUpDetails details) { | ||
switch (_getEffectiveConsecutiveTapCount(details.consecutiveTapCount)) { | ||
case 1: | ||
switch (defaultTargetPlatform) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reviews @chunhtai and @justinmc. I was giving this a final look and may have noticed something I missed. In the test below when clicking between different selectables the selection is not cleared. Before this pr every click/tap would clear the selection, but now every click/tap is setting the selection. Should we be clearing the selection on the selectables that do not contain the click/tapped location? I'm leaning towards that we should, but what do you both think? Some more context, on the native browser it seems like the selection is nulled for a node when clicking on another node, you can observe this behavior in this demo https://jsfiddle.net/mwt7fp6v/ . When clicking on a new node, in the case of the demo testWidgets('Test collapsing selection at multiple selectables', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
child: const Column(
children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
],
),
),
),
);
final RenderParagraph paragraph1 = tester.renderObject<RenderParagraph>(find.descendant(of: find.text('How are you?'), matching: find.byType(RichText)));
final TestGesture gesture = await tester.startGesture(textOffsetToPosition(paragraph1, 2), kind: PointerDeviceKind.mouse);
addTearDown(gesture.removePointer);
await tester.pump();
await gesture.up();
await tester.pumpAndSettle();
expect(paragraph1.selections[0], const TextSelection.collapsed(offset: 2));
final RenderParagraph paragraph2 = tester.renderObject<RenderParagraph>(find.descendant(of: find.text('Good, and you?'), matching: find.byType(RichText)));
await gesture.down(textOffsetToPosition(paragraph2, 5));
await tester.pump();
await gesture.up();
await tester.pumpAndSettle();
expect(paragraph1.selections[0], const TextSelection.collapsed(offset: 12)); // should this be null?
expect(paragraph2.selections[0], const TextSelection.collapsed(offset: 5));
final RenderParagraph paragraph3 = tester.renderObject<RenderParagraph>(find.descendant(of: find.text('Fine, thank you.'), matching: find.byType(RichText)));
await gesture.down(textOffsetToPosition(paragraph3, 13));
await tester.pump();
await gesture.up();
await tester.pumpAndSettle();
expect(paragraph1.selections[0], const TextSelection.collapsed(offset: 12)); // should this be null?
expect(paragraph2.selections[0], const TextSelection.collapsed(offset: 14)); // should this be null?
expect(paragraph3.selections[0], const TextSelection.collapsed(offset: 13));
}); |
It would be good if we can clear out selection in other unrelated selectable, but I think that may be hard to do? or may make the code messy. If we don't clear our selection on unrelated selectable, there may be something we should think about.
My suggestion would be if there is a clean way to clear out selection, then we should go for it. |
a8b11ca
to
8b33e97
Compare
@chunhtai Thank you for the suggestion! I agree that if we can clear the selection we probably should. I think there are a few ways we can approach this and have included some of them in this commit 8b33e97#diff-3c64e39c4f244a98f70ed8374eabfb2a4d4eeca07cd90a8f90abe4bc226bfe7f . The options the following:
Some options that do not work but I considered:
Let me know what you think. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we would like to clear out other selectable, I think this would also apply to select word/line/paragraph.
- A new CollapseSelectionSelectionEvent (or CollapseSelectionEvent) . This will set both selection edges and clear the selection on all other selectables. Similar to SelectWordSelectionEvent.
How do you clear other selectable? I imagine you will do something very similar to (2) to clear the selection. I think implementing 2 is fine as long as we keep the logic internal to MultiSelectableSelectionContainerDelegate and keep it self-contain. WDYT?
_selectableContainsOriginWord = true; | ||
|
||
final TextPosition position = paragraph.getPositionForOffset(paragraph.globalToLocal(globalPosition)); | ||
if (_positionIsWithinCurrentSelection(position) && _textSelectionStart != _textSelectionEnd) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems weird if that the selection does not collapse when receiving collapse selection event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be very similar to SelectWord, and probably SelectLine and SelectParagraph. What's the plan for expanding these functionality? An alternative is to use a single Selection event with different granularity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that, this block of code was pulled from _handleSelectWord
s existing implementation so that case probably needs an adjustment or to be removed entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be very similar to SelectWord, and probably SelectLine and SelectParagraph. What's the plan for expanding these functionality? An alternative is to use a single Selection event with different granularity
This will be addressed in the triple click gestures pr if we choose not to add a new selection event here.
@@ -1715,11 +1717,30 @@ class _SelectableFragment with Selectable, ChangeNotifier implements TextLayoutM | |||
return SelectionResult.none; | |||
} | |||
|
|||
SelectionResult _handleCollapseSelection(Offset globalPosition) { | |||
_selectableContainsOriginWord = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this set too soon? this may return SelectionResult.previous
or SelectionResult.next
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I'll keep this in mind. This block of code was pulled from _handleSelectWord
s existing implementation so that probably needs a change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the addition of the new selection event to clear the selections seems like a solid approach.
case TargetPlatform.android: | ||
case TargetPlatform.fuchsia: | ||
case TargetPlatform.iOS: | ||
// On mobile platforms the selection is set on tap up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, thank you for checking!
/// * [_selectStartTo], which sets or updates selection start edge. | ||
/// * [_selectEndTo], which sets or updates selection end edge. | ||
/// * [_finalizeSelection], which stops the `continuous` updates. | ||
/// * [_clearSelection], which clear the ongoing selection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"clear" => "clears"
/// Collapses the selection at the location. | ||
/// | ||
/// This event can be sent as the result of a single click/tap to move the selection. | ||
class CollapseSelectionSelectionEvent extends SelectionEvent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think you can remove the duplicate "Selection" in the name: CollapseSelectionEvent
// _selectEndTo(offset: offset); | ||
|
||
// This works to clear all unrelated selections but relies on a new selection event. | ||
_selectable?.dispatchSelectionEvent(CollapseSelectionSelectionEvent(globalPosition: offset)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chun Heng should really have the final word, but I think dispatching a new event here seems fine...
Yes it would be implemented very similar to (2). I think that ideally setting the start and end edge to the same position would collapse it by default, and not leave any ongoing unrelated selections. What if we implement this private method, but instead of calling it in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it would be implemented very similar to (2). I think that ideally setting the start and end edge to the same position would collapse it by default, and not leave any ongoing unrelated selections. What if we implement this private method, but instead of calling it in _collapseSelectionAt we call it in _initSelection and _adjustSelection. This way we will clear any inactive selections when setting the start/end edge. Something like this 936a2d5 . If this does not seem reasonable then i'm okay calling the private method from _collapseSelectionAt. Let me know what you think.
In which case would _collapseSelectionAt
be invoked? Do you call it when receiving both selectStartAt and selectEndAt the same location back to back? Either way, this sounds fine to me.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -2366,6 +2440,7 @@ abstract class MultiSelectableSelectionContainerDelegate extends SelectionContai | |||
} else { | |||
currentSelectionStartIndex = newIndex; | |||
} | |||
_flushInactiveSelections(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just something to keep in mind, we know which selectables currently have selection after the adjustment, we need to go through the entire selectable list. This is fine as long as the performance is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, i'll keep an eye out for any performance regressions. Another good case for flushing inactive selections might be when doing shift + click
to expand the selection to the clicked position. If we have unrelated selections in the selectable tree the logic might be tricky to implement.
7fe1ca0
to
2abc97e
Compare
…r walk through the selectable tree is inside the current viewport. If not we might walk through the tree incorrectly as the correct transformation calculations are not possible when the edge is not within the viewport
06bed89
to
c34609f
Compare
Roll Flutter from ff4a0f676f41 to 57b5c3cda000 (47 revisions) flutter/flutter@ff4a0f6...57b5c3c 2023-09-29 engine-flutter-autoroll@skia.org Roll Packages from c070b0a to d0e9a0e (5 revisions) (flutter/flutter#135753) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from db4d3b5b3f59 to c52251a8b2d0 (1 revision) (flutter/flutter#135748) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8b4e633c65eb to db4d3b5b3f59 (2 revisions) (flutter/flutter#135745) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 09130bf5be97 to 8b4e633c65eb (1 revision) (flutter/flutter#135744) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from ccb30585d3f3 to 09130bf5be97 (1 revision) (flutter/flutter#135741) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2052515c44f3 to ccb30585d3f3 (1 revision) (flutter/flutter#135737) 2023-09-29 godofredoc@google.com Update localizations. (flutter/flutter#135691) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 485543c6765a to 2052515c44f3 (4 revisions) (flutter/flutter#135732) 2023-09-29 54558023+keyonghan@users.noreply.github.com Add arch property for windows_arm64 platform (flutter/flutter#135725) 2023-09-29 jonahwilliams@google.com [flutter_tools] remove VmService screenshot for native devices. (flutter/flutter#135462) 2023-09-29 polinach@google.com Pin leak_tracker before publishing breaking change. (flutter/flutter#135720) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from cc7c3c1f0f41 to 485543c6765a (8 revisions) (flutter/flutter#135717) 2023-09-28 katelovett@google.com Remove assertions on getOffsetToReveal (flutter/flutter#135634) 2023-09-28 fluttergithubbot@gmail.com Marks Linux_android flutter_gallery__start_up_delayed to be unflaky (flutter/flutter#135565) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from dbb60932a6ab to cc7c3c1f0f41 (2 revisions) (flutter/flutter#135701) 2023-09-28 yjbanov@google.com [tool] fallback to sigkill when closing Chromium (flutter/flutter#135521) 2023-09-28 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#135455) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9789dbc2ec3f to dbb60932a6ab (2 revisions) (flutter/flutter#135694) 2023-09-28 leroux_bruno@yahoo.fr Fix TabBarView.viewportFraction change is ignored (flutter/flutter#135590) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from d9eaebd05851 to 9789dbc2ec3f (2 revisions) (flutter/flutter#135688) 2023-09-28 matheus@btor.com.br Added option to disable [NavigationDestination]s ([NavigationBar] destination widget) (flutter/flutter#132361) 2023-09-28 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Marks Windows module_custom_host_app_name_test to be unflaky" (flutter/flutter#135692) 2023-09-28 github@alexv525.com � Add more fields to `RefreshProgressIndicator` (flutter/flutter#135207) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 82b69dadc07a to d9eaebd05851 (1 revision) (flutter/flutter#135679) 2023-09-28 andrewrkolos@gmail.com Add API to read flavor from framework at run time (flutter/flutter#134179) 2023-09-28 fluttergithubbot@gmail.com Marks Windows module_custom_host_app_name_test to be unflaky (flutter/flutter#135567) 2023-09-28 tauu@h2overclock.de [web] fix: do not call onSubmitted of TextField when switching browser tabs on mobile web (flutter/flutter#134870) 2023-09-28 engine-flutter-autoroll@skia.org Roll Packages from 21c2ebb to c070b0a (3 revisions) (flutter/flutter#135676) 2023-09-28 tessertaha@gmail.com Fix `RangeSlider` throws an exception in a `ListView` (flutter/flutter#135667) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from d09c2dbe2292 to 82b69dadc07a (2 revisions) (flutter/flutter#135675) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 495955a3b5de to d09c2dbe2292 (1 revision) (flutter/flutter#135669) 2023-09-28 zanderso@users.noreply.github.com Revert "Upload generated frame-request-pending stats" (flutter/flutter#135672) 2023-09-28 smartercallum@gmail.com Upload generated frame-request-pending stats (flutter/flutter#135645) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 937bf0432214 to 495955a3b5de (1 revision) (flutter/flutter#135665) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from d2540d87fd96 to 937bf0432214 (1 revision) (flutter/flutter#135660) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from c47faed53afe to d2540d87fd96 (2 revisions) (flutter/flutter#135652) 2023-09-28 tessertaha@gmail.com Update `TextField.style` documentation for Material 3 (flutter/flutter#135556) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 44aef2e61718 to c47faed53afe (1 revision) (flutter/flutter#135647) 2023-09-28 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from be32dcc9117a to 44aef2e61718 (4 revisions) (flutter/flutter#135646) 2023-09-28 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from f70f65f7a622 to be32dcc9117a (31 revisions) (flutter/flutter#135637) 2023-09-28 rmolivares@renzo-olivares.dev Implement SelectionArea single click/tap gestures (flutter/flutter#132682) 2023-09-27 katelovett@google.com Support ensureVisible/showOnScreen/showInViewport for 2D Scrolling (flutter/flutter#135182) 2023-09-27 caseycrogers@berkeley.edu made top level if checks gaurd clauses (flutter/flutter#135070) 2023-09-27 tessertaha@gmail.com Fix `SearchAnchor`'s search view isn't updated when the theme changes & widgets inside the search view do not inherit local themes (flutter/flutter#132749) 2023-09-27 godofredoc@google.com Config changes for linux coverage. (flutter/flutter#135604) 2023-09-27 engine-flutter-autoroll@skia.org Roll Packages from 619af75 to 21c2ebb (6 revisions) (flutter/flutter#135602) ...
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
…r#5036) Roll Flutter from ff4a0f676f41 to 57b5c3cda000 (47 revisions) flutter/flutter@ff4a0f6...57b5c3c 2023-09-29 engine-flutter-autoroll@skia.org Roll Packages from c070b0a to d0e9a0e (5 revisions) (flutter/flutter#135753) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from db4d3b5b3f59 to c52251a8b2d0 (1 revision) (flutter/flutter#135748) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8b4e633c65eb to db4d3b5b3f59 (2 revisions) (flutter/flutter#135745) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 09130bf5be97 to 8b4e633c65eb (1 revision) (flutter/flutter#135744) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from ccb30585d3f3 to 09130bf5be97 (1 revision) (flutter/flutter#135741) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2052515c44f3 to ccb30585d3f3 (1 revision) (flutter/flutter#135737) 2023-09-29 godofredoc@google.com Update localizations. (flutter/flutter#135691) 2023-09-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 485543c6765a to 2052515c44f3 (4 revisions) (flutter/flutter#135732) 2023-09-29 54558023+keyonghan@users.noreply.github.com Add arch property for windows_arm64 platform (flutter/flutter#135725) 2023-09-29 jonahwilliams@google.com [flutter_tools] remove VmService screenshot for native devices. (flutter/flutter#135462) 2023-09-29 polinach@google.com Pin leak_tracker before publishing breaking change. (flutter/flutter#135720) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from cc7c3c1f0f41 to 485543c6765a (8 revisions) (flutter/flutter#135717) 2023-09-28 katelovett@google.com Remove assertions on getOffsetToReveal (flutter/flutter#135634) 2023-09-28 fluttergithubbot@gmail.com Marks Linux_android flutter_gallery__start_up_delayed to be unflaky (flutter/flutter#135565) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from dbb60932a6ab to cc7c3c1f0f41 (2 revisions) (flutter/flutter#135701) 2023-09-28 yjbanov@google.com [tool] fallback to sigkill when closing Chromium (flutter/flutter#135521) 2023-09-28 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#135455) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9789dbc2ec3f to dbb60932a6ab (2 revisions) (flutter/flutter#135694) 2023-09-28 leroux_bruno@yahoo.fr Fix TabBarView.viewportFraction change is ignored (flutter/flutter#135590) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from d9eaebd05851 to 9789dbc2ec3f (2 revisions) (flutter/flutter#135688) 2023-09-28 matheus@btor.com.br Added option to disable [NavigationDestination]s ([NavigationBar] destination widget) (flutter/flutter#132361) 2023-09-28 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Marks Windows module_custom_host_app_name_test to be unflaky" (flutter/flutter#135692) 2023-09-28 github@alexv525.com ð��� Add more fields to `RefreshProgressIndicator` (flutter/flutter#135207) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 82b69dadc07a to d9eaebd05851 (1 revision) (flutter/flutter#135679) 2023-09-28 andrewrkolos@gmail.com Add API to read flavor from framework at run time (flutter/flutter#134179) 2023-09-28 fluttergithubbot@gmail.com Marks Windows module_custom_host_app_name_test to be unflaky (flutter/flutter#135567) 2023-09-28 tauu@h2overclock.de [web] fix: do not call onSubmitted of TextField when switching browser tabs on mobile web (flutter/flutter#134870) 2023-09-28 engine-flutter-autoroll@skia.org Roll Packages from 21c2ebb to c070b0a (3 revisions) (flutter/flutter#135676) 2023-09-28 tessertaha@gmail.com Fix `RangeSlider` throws an exception in a `ListView` (flutter/flutter#135667) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from d09c2dbe2292 to 82b69dadc07a (2 revisions) (flutter/flutter#135675) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 495955a3b5de to d09c2dbe2292 (1 revision) (flutter/flutter#135669) 2023-09-28 zanderso@users.noreply.github.com Revert "Upload generated frame-request-pending stats" (flutter/flutter#135672) 2023-09-28 smartercallum@gmail.com Upload generated frame-request-pending stats (flutter/flutter#135645) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 937bf0432214 to 495955a3b5de (1 revision) (flutter/flutter#135665) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from d2540d87fd96 to 937bf0432214 (1 revision) (flutter/flutter#135660) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from c47faed53afe to d2540d87fd96 (2 revisions) (flutter/flutter#135652) 2023-09-28 tessertaha@gmail.com Update `TextField.style` documentation for Material 3 (flutter/flutter#135556) 2023-09-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 44aef2e61718 to c47faed53afe (1 revision) (flutter/flutter#135647) 2023-09-28 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from be32dcc9117a to 44aef2e61718 (4 revisions) (flutter/flutter#135646) 2023-09-28 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from f70f65f7a622 to be32dcc9117a (31 revisions) (flutter/flutter#135637) 2023-09-28 rmolivares@renzo-olivares.dev Implement SelectionArea single click/tap gestures (flutter/flutter#132682) 2023-09-27 katelovett@google.com Support ensureVisible/showOnScreen/showInViewport for 2D Scrolling (flutter/flutter#135182) 2023-09-27 caseycrogers@berkeley.edu made top level if checks gaurd clauses (flutter/flutter#135070) 2023-09-27 tessertaha@gmail.com Fix `SearchAnchor`'s search view isn't updated when the theme changes & widgets inside the search view do not inherit local themes (flutter/flutter#132749) 2023-09-27 godofredoc@google.com Config changes for linux coverage. (flutter/flutter#135604) 2023-09-27 engine-flutter-autoroll@skia.org Roll Packages from 619af75 to 21c2ebb (6 revisions) (flutter/flutter#135602) ...
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 thewindow.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
Pre-launch Checklist
///
).