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
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 20, 2023
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