-
Notifications
You must be signed in to change notification settings - Fork 6k
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] Fixes drag scrolling in embedded mode. #53647
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This prevents (mobile) browsers from sending a 'touchcancel' event shortly after users start to drag on a scrollable list, when the app is embedded in a host element. This PR also ensures: * all pointer events are registered on the _viewTarget. This uses `setPointerCapture` so move/up/cancel events keep being reported even when the pointer leaves the _viewTarget. * pointer events are registered only ONCE :)
This was referenced Jun 29, 2024
Closed
yjbanov
approved these changes
Jun 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 29, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 29, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 29, 2024
Great job @ditman, thanks for fixing this! |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 29, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 29, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 29, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 29, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 30, 2024
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jun 30, 2024
…151062) flutter/engine@ad1343c...0d93da7 2024-06-30 [email protected] Roll Fuchsia Linux SDK from zU9wwHk8Oji6pArmw... to DSPuQ9O6WejkIBUUh... (flutter/engine#53657) 2024-06-29 [email protected] Roll Dart SDK from e1e2b16d509b to ab6a48438e07 (1 revision) (flutter/engine#53655) 2024-06-29 [email protected] Roll Skia from 2df28ce437cc to 34be7c830184 (1 revision) (flutter/engine#53654) 2024-06-29 [email protected] Roll Skia from bc0e9542ce83 to 2df28ce437cc (1 revision) (flutter/engine#53652) 2024-06-29 [email protected] Roll Fuchsia Linux SDK from H_P7EHb4zXXV-Eiik... to zU9wwHk8Oji6pArmw... (flutter/engine#53649) 2024-06-29 [email protected] [web] Fixes drag scrolling in embedded mode. (flutter/engine#53647) 2024-06-29 [email protected] Roll Dart SDK from 160ace00da8a to e1e2b16d509b (1 revision) (flutter/engine#53646) 2024-06-28 [email protected] Roll Skia from 1ad84eb8e94f to bc0e9542ce83 (1 revision) (flutter/engine#53644) 2024-06-28 [email protected] Roll Dart SDK from 89b164e3adeb to 160ace00da8a (1 revision) (flutter/engine#53643) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from H_P7EHb4zXXV to DSPuQ9O6Wejk 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 [email protected],[email protected],[email protected] 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
victorsanni
pushed a commit
to victorsanni/flutter
that referenced
this pull request
Jul 8, 2024
…lutter#151062) flutter/engine@ad1343c...0d93da7 2024-06-30 [email protected] Roll Fuchsia Linux SDK from zU9wwHk8Oji6pArmw... to DSPuQ9O6WejkIBUUh... (flutter/engine#53657) 2024-06-29 [email protected] Roll Dart SDK from e1e2b16d509b to ab6a48438e07 (1 revision) (flutter/engine#53655) 2024-06-29 [email protected] Roll Skia from 2df28ce437cc to 34be7c830184 (1 revision) (flutter/engine#53654) 2024-06-29 [email protected] Roll Skia from bc0e9542ce83 to 2df28ce437cc (1 revision) (flutter/engine#53652) 2024-06-29 [email protected] Roll Fuchsia Linux SDK from H_P7EHb4zXXV-Eiik... to zU9wwHk8Oji6pArmw... (flutter/engine#53649) 2024-06-29 [email protected] [web] Fixes drag scrolling in embedded mode. (flutter/engine#53647) 2024-06-29 [email protected] Roll Dart SDK from 160ace00da8a to e1e2b16d509b (1 revision) (flutter/engine#53646) 2024-06-28 [email protected] Roll Skia from 1ad84eb8e94f to bc0e9542ce83 (1 revision) (flutter/engine#53644) 2024-06-28 [email protected] Roll Dart SDK from 89b164e3adeb to 160ace00da8a (1 revision) (flutter/engine#53643) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from H_P7EHb4zXXV to DSPuQ9O6Wejk 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 [email protected],[email protected],[email protected] 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
8 tasks
auto-submit bot
pushed a commit
that referenced
this pull request
Jul 17, 2024
This PR adds `touch-action:none` to `flutter-view` elements, so the browser lets the flutter engine fully handle all touch gestures. This fix is more delicate than the first approach, which broke some merged taps when accessibility/semantics are enabled. ## Issues * Found while testing: flutter/flutter#130950 * "More correct" fix for: #53647 ## Demos * Flutter scroll: https://dit-multiview-scroll.web.app * Semantics: https://dit-tests.web.app * Scrollable platform views: https://dit-multiview-tests.web.app [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
ditman
added a commit
to ditman/flutter-engine
that referenced
this pull request
Jul 19, 2024
This PR adds `touch-action:none` to `flutter-view` elements, so the browser lets the flutter engine fully handle all touch gestures. This fix is more delicate than the first approach, which broke some merged taps when accessibility/semantics are enabled. ## Issues * Found while testing: flutter/flutter#130950 * "More correct" fix for: flutter#53647 ## Demos * Flutter scroll: https://dit-multiview-scroll.web.app * Semantics: https://dit-tests.web.app * Scrollable platform views: https://dit-multiview-tests.web.app [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This was referenced Jul 19, 2024
Failed to create CP due to merge conflicts. |
auto-submit bot
pushed a commit
that referenced
this pull request
Aug 14, 2024
This PR adds `touch-action:none` to `flutter-view` elements, so the browser lets the flutter engine fully handle all touch gestures. This fix is more delicate than the first approach, which broke some merged taps when accessibility/semantics are enabled. ## Issues * Found while testing: flutter/flutter#130950 * "More correct" fix for: #53647 ## Demos * Flutter scroll: https://dit-multiview-scroll.web.app * Semantics: https://dit-tests.web.app * Scrollable platform views: https://dit-multiview-tests.web.app [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* --- ### Cherry-pick of #53945 * Fixes: flutter/flutter#152047
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
cp: stable
cherry pick to the stable release candidate branch
platform-web
Code specifically for the web engine
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When Flutter web runs embedded in a page, scrolling by dragging is interrupted very early by the browser.
It turns out that our
pointer
events receive apointercancel
+pointerleave
by the browser because they happen in an area (the flutter glasspane) that is not really scrollable. See documentation.Note
After the pointercancel event is fired, the browser will also send pointerout followed by pointerleave.
(Firefox is a good browser to test this, because the browser will cancel our events only if there's scrollable areas around the embedded flutter app.)
There's several solutions, but one of them (used by PixiJS as well) is to cancel the
touchstart
event that fires with thepointerdown
event.(This PR also removes an unnecessary call to
addEventListener
in theListener
helper class, and adds some testing to it).Testing
Issues
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.