Skip to content

Conversation

@moffatman
Copy link
Contributor

Usually pointer interaction is disabled during a drag scroll. Now that trackpad uses a continuous/drag scroll, this should be changed so that mouse hover effects and clicking is possible as it was before recent changes.

Fixes #105308

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.

@flutter-dashboard flutter-dashboard bot added f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels Jun 30, 2022
@HansMuller HansMuller requested a review from dkwingsmt July 1, 2022 21:43
@moffatman moffatman force-pushed the trackpad_scrollable_interactive branch from f4b062d to 64ee8bd Compare July 8, 2022 04:12
expect(find.text('Page 9'), findsOneWidget);
});

testWidgets('Scroll device type controls whether pointer is ignored.', (WidgetTester tester) async {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
testWidgets('Scroll device type controls whether pointer is ignored.', (WidgetTester tester) async {
testWidgets('Pointer is not ignored during trackpad scrolling.', (WidgetTester tester) async {

@moffatman moffatman force-pushed the trackpad_scrollable_interactive branch 2 times, most recently from 77de568 to 486756b Compare July 15, 2022 16:16
@goderbauer goderbauer requested a review from dkwingsmt July 20, 2022 16:48
@moffatman moffatman force-pushed the trackpad_scrollable_interactive branch from 486756b to f7ff2fa Compare July 25, 2022 15:14
@dkwingsmt
Copy link
Contributor

dkwingsmt commented Jul 25, 2022

A test is failing because PointerDownEvent is created with kind trackpad. Is it supposed to?

@moffatman
Copy link
Contributor Author

A test is failing because PointerDownEvent is created with kind trackpad. Is it supposed to?

Was being lazy with testing the trackpad processing. I added some proper event synthesis functions and used those instead.

@goderbauer
Copy link
Member

Fly-by comment from triage: looks like the analyzer is unhappy.

@moffatman moffatman force-pushed the trackpad_scrollable_interactive branch from 2c128a0 to 1c8623e Compare August 5, 2022 03:52
Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

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

LGTM

@dkwingsmt
Copy link
Contributor

cc @Piinks

super.delegate,
Simulation simulation,
TickerProvider vsync,
this.shouldIgnorePointer,
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be a breaking change, let me run some internal tests first. One way to work around this is to make it an optional parameter with a default behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually I was able to do a quick look up and found no uses of this class internally. ✅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did find a breakage in an external package while testing this with my existing code, but they were only overriding BallisticScrollActivity to perform the exact same function as here.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

What happens if the user tries to drag again before the activity finishes? Will it crash? I see the test checks for tapping, but what if the user tries to drag scroll? I think the scroll view might throw because it can only have one active drag at a time..

@moffatman
Copy link
Contributor Author

What happens if the user tries to drag again before the activity finishes?
I'm not sure what you mean about having two active drags at once. Once the ballistic activity starts, the previous drag has finished. And a second drag/finger during the dragging phase will be handled by the same recognizer, there won't be two drags.

@Piinks
Copy link
Contributor

Piinks commented Aug 17, 2022

Just double checking common crashes when we make changes like these. 😉
I've checked this out and tried it, it doesn't get caught in that logic.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

LGTM

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 17, 2022
@auto-submit auto-submit bot merged commit 09e400e into flutter:master Aug 17, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 18, 2022
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 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.

Scrolling on macOS disables gesture interaction

4 participants