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

[web] Pointer events support multi-view #137289

Closed
mdebbar opened this issue Oct 25, 2023 · 2 comments · Fixed by flutter/engine#48248
Closed

[web] Pointer events support multi-view #137289

mdebbar opened this issue Oct 25, 2023 · 2 comments · Fixed by flutter/engine#48248
Assignees
Labels
engine flutter/engine repository. See also e: labels. f: gestures flutter/packages/flutter/gestures repository. P1 High-priority issues at the top of the work list platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team

Comments

@mdebbar
Copy link
Contributor

mdebbar commented Oct 25, 2023

This is a tracking issue for the work to make pointer events support multi-view on the web.

Summary: The PointerData class has a new viewId parameter that we should use to indicate which view received the pointer event.

Questions:

  1. Are pointer event offsets supposed to be relative to the top-left of the Flutter View that received them?
  2. What's the expectation when drag-n-dropping across Flutter Views?
    • Is the down state shared across all views?
    • Should we send move events to the source view and hover events to the destination view?

cc @goderbauer @ditman

@mdebbar mdebbar added engine flutter/engine repository. See also e: labels. f: gestures flutter/packages/flutter/gestures repository. platform-web Web applications specifically P1 High-priority issues at the top of the work list team-web Owned by Web platform team triaged-web Triaged by Web platform team labels Oct 25, 2023
@mdebbar mdebbar self-assigned this Oct 25, 2023
@goderbauer
Copy link
Member

Are pointer event offsets supposed to be relative to the top-left of the Flutter View that received them?

Yes.

What's the expectation when drag-n-dropping across Flutter Views?

Good question, so far, we haven't really been considering pointer events that span multiple views. I imagine that the down state would be shared across views. I wonder what the current behavior is if a pointer goes down outside of a view and then enters it.

auto-submit bot pushed a commit to flutter/engine that referenced this issue Dec 11, 2023
- Move initialization of `PointerBinding`/`KeyboardBinding` out of `FlutterViewEmbedder`.
- `computeEventOffsetToTarget` properly handles events within a given view.
- `PointerBinding` operates on the given Flutter view (it still listens to some `domWindow` events for the implicit view).
    - Stop using globals e.g. `ui.window`, `KeyboardBinding.instance`, `SafariPointerEventWorkaround.instance`, etc.
- `pointer_binding_test.dart` doesn't use globals either.
- `clickDebouncer` is now a static property on `PointerBinding`.

Fixes flutter/flutter#137289
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engine flutter/engine repository. See also e: labels. f: gestures flutter/packages/flutter/gestures repository. P1 High-priority issues at the top of the work list platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants