Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Oct 19, 2023

There's no reason (that we know of) to listen to pointer events during the capture phase, so let's listen on the bubble phase.

I couldn't find a reason for listening to pointer events during the capture phase. So let's listen on the bubble phase which is more natural and allows platform views to stopPropagation in order to prevent Flutter from receiving an event.

@mdebbar mdebbar requested a review from yjbanov October 19, 2023 19:15
@github-actions github-actions bot added the platform-web Code specifically for the web engine label Oct 19, 2023
Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

LGTM with one nit


// ALL ADAPTERS

_testEach(
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's leave a comment explaining why we test this. IIRC, we have two use-cases:

  • The native text field.
  • Platform views: there are cases when a platform view wants to handle an event and not propagate it to Flutter, but because Flutter listens during the capture phase, by the time the event reaches the platform view it's too late to stop propagation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 20, 2023
@auto-submit auto-submit bot merged commit 9c9e8ad into flutter:main Oct 20, 2023
@mdebbar mdebbar deleted the pointer_capture branch October 20, 2023 16:07
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 20, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 20, 2023
flutter/engine@21b5c37...d46933e

2023-10-20 skia-flutter-autoroll@skia.org Roll Skia from 461218cee44c to de628929015d (1 revision) (flutter/engine#47161)
2023-10-20 mdebbar@google.com [web] Make HotRestartCacheHandler standalone (flutter/engine#46906)
2023-10-20 mdebbar@google.com [web] Attach pointer event listeners in the bubble phase (flutter/engine#47121)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jimgraham@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
There's no reason (that we know of) to listen to pointer events during the capture phase, so let's listen on the bubble phase.

I couldn't find a reason for listening to pointer events during the capture phase. So let's listen on the bubble phase which is more natural and allows platform views to `stopPropagation` in order to prevent Flutter from receiving an event.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants