Skip to content
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

Merged
merged 26 commits into from
Sep 28, 2023

Conversation

Renzo-Olivares
Copy link
Contributor

@Renzo-Olivares Renzo-Olivares commented Aug 16, 2023

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

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Aug 16, 2023
@github-actions github-actions bot added d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels Aug 16, 2023
@github-actions github-actions bot added the f: material design flutter/packages/flutter/material repository. label Aug 17, 2023
Copy link
Contributor

@chunhtai chunhtai left a 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
Copy link
Contributor

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);
Copy link
Contributor

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?

Copy link
Contributor

@justinmc justinmc left a 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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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}) {
Copy link
Contributor

@justinmc justinmc Aug 18, 2023

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Renzo-Olivares
Copy link
Contributor Author

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 <p>, the other paragraphs do not contain a selection when using Selection.containsNode(), only the paragraph at the tapped location contains the collapsed selection.

    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));
    });

@chunhtai chunhtai self-requested a review August 22, 2023 17:43
@chunhtai
Copy link
Contributor

chunhtai commented Aug 22, 2023

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.

  1. This may affect how we are going to implement text cursor accessibility settings See https://support.google.com/chrome/answer/10129654?hl=en
    Although I don't think this will be a problem because we have selectionGemeotry to tell us exactly where to paint the text cursor.

  2. we may one day want to implement onSelectionChange in Text widget. Developer won't be able to tell whether the text does receive active collapsed selection vs no selection.

My suggestion would be if there is a clean way to clear out selection, then we should go for it.

@github-actions github-actions bot added the f: scrolling Viewports, list views, slivers, etc. label Aug 23, 2023
@Renzo-Olivares
Copy link
Contributor Author

@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:

  1. A new CollapseSelectionSelectionEvent (or CollapseSelectionEvent) . This will set both selection edges and clear the selection on all other selectables. Similar to SelectWordSelectionEvent.
  2. Implement a private method to clear all other unrelated selections /or selections that do not fall within the currentSelectionStartIndex and currentSelectionEndIndex range of the selection delegate. It would be used like _selectionDelegate.handleClearAllOtherSelections() after we update the start/end edge to collapse it. This seems like a departure from dispatching selection events so this does not sound so clean. Another potential avenue we can take is create a new selection event ClearAllOtherSelectionEvent to do this but I am not sure if such an API makes sense.

Some options that do not work but I considered:

  1. Calling _clearSelection() before updating the start/end edge to collapse the selection. This does clear the selection but after when we dispatch a SelectionEdgeUpdateEvent it dispatches to every selectable until reaching the target, so the selection is set once again in unrelated selectables.

Let me know what you think. Thanks!

@Renzo-Olivares Renzo-Olivares requested review from chunhtai and removed request for chunhtai August 23, 2023 18:03
Copy link
Contributor

@chunhtai chunhtai left a 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.

  1. 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) {
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor Author

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 _handleSelectWords existing implementation so that case probably needs an adjustment or to be removed entirely.

Copy link
Contributor Author

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;
Copy link
Contributor

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

Copy link
Contributor Author

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 _handleSelectWords existing implementation so that probably needs a change.

Copy link
Contributor

@justinmc justinmc left a 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.
Copy link
Contributor

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.
Copy link
Contributor

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 {
Copy link
Contributor

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));
Copy link
Contributor

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...

@Renzo-Olivares
Copy link
Contributor Author

If we would like to clear out other selectable, I think this would also apply to select word/line/paragraph.

  1. 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?

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.

Copy link
Contributor

@chunhtai chunhtai left a 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.

@Renzo-Olivares
Copy link
Contributor Author

Renzo-Olivares commented Sep 1, 2023

_collapseSelectionAt in SelectableRegion calls selectStartTo and selectEndTo. The MultiSelectableContainerDelegate is then responsible for flushing the unrelated selections when each edge is updated (when a SelectionEdgeUpdateEvent is dispatched).

Copy link
Contributor

@chunhtai chunhtai left a 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();
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@Renzo-Olivares Renzo-Olivares force-pushed the selection-area-singletap branch 3 times, most recently from 7fe1ca0 to 2abc97e Compare September 12, 2023 17:14
…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
@Renzo-Olivares Renzo-Olivares added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 28, 2023
@auto-submit auto-submit bot merged commit 21ad712 into flutter:master Sep 28, 2023
67 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 29, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 29, 2023
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)
...
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Oct 10, 2023
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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2023
HugoOlthof pushed a commit to moneybird/packages that referenced this pull request Dec 13, 2023
…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)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SelectionArea supported gestures should have feature parity with TextSelectionGestureDetector
3 participants