-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Move blur event reset into non-touch handlers #11087
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
ansis
approved these changes
Oct 5, 2021
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.
This looks good to me!
The main concern here is that we lose out on a couple things that the stop method does:
fireEvents still gets called later on if necessary and I don't think the inertia will cause any problems.
rreusser
added a commit
that referenced
this pull request
Oct 5, 2021
* fix an iOS15 issue where map stops when panning * fix tests and lint * Test drag pan handler does not end interaction on resize * Move blur event reset into non-touch handlers (#11087) * Move blur event reset into non-touch handlers * Fix linter * Fix/amend unit tests * Flush task queue in rotate test Co-authored-by: Ricky Reusser <ricky.reusser@mapbox.com> Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>
rreusser
added a commit
that referenced
this pull request
Oct 5, 2021
* fix an iOS15 issue where map stops when panning * fix tests and lint * Test drag pan handler does not end interaction on resize * Move blur event reset into non-touch handlers (#11087) * Move blur event reset into non-touch handlers * Fix linter * Fix/amend unit tests * Flush task queue in rotate test Co-authored-by: Ricky Reusser <ricky.reusser@mapbox.com> Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>
rreusser
added a commit
that referenced
this pull request
Oct 6, 2021
…11089) * fix an iOS15 issue where map stops when panning * fix tests and lint * Test drag pan handler does not end interaction on resize * Move blur event reset into non-touch handlers (#11087) * Move blur event reset into non-touch handlers * Fix linter * Fix/amend unit tests * Flush task queue in rotate test Co-authored-by: Ricky Reusser <ricky.reusser@mapbox.com> Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com> Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
avpeery
pushed a commit
that referenced
this pull request
Oct 6, 2021
…11089) * fix an iOS15 issue where map stops when panning * fix tests and lint * Test drag pan handler does not end interaction on resize * Move blur event reset into non-touch handlers (#11087) * Move blur event reset into non-touch handlers * Fix linter * Fix/amend unit tests * Flush task queue in rotate test Co-authored-by: Ricky Reusser <ricky.reusser@mapbox.com> Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com> Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
avpeery
added a commit
that referenced
this pull request
Oct 7, 2021
…11101) * Fix an iOS15 issue where Safari tab bar interrupts panning (#11084) (#11089) * fix an iOS15 issue where map stops when panning * fix tests and lint * Test drag pan handler does not end interaction on resize * Move blur event reset into non-touch handlers (#11087) * Move blur event reset into non-touch handlers * Fix linter * Fix/amend unit tests * Flush task queue in rotate test Co-authored-by: Ricky Reusser <ricky.reusser@mapbox.com> Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com> Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com> * Removed getBoundingClientRect conflict for unit tests * Added offsetHeight to replace getBoundingClientRect to fix unit tests * add clientWidth and clientHeight to unit tests * container -> map.getContainer() * Replaced offsetWidth with clientWidth * removing change difference in attribution and logo unit tests from v1.13.2 * Change size of container instead of canvas container to trigger resize in unit tests * Added change in height to trigger resize * fix to attribution.test.js * Fixes logo.test.js to pass * removed unneeded changes Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com> Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related to #11048, the tab bar toggle also emits a window
blur
event which interrupts interactions when the page is initially opened:IMG_0104.mp4
Simply removing all blur handling has this effect on desktop, in which interactions continue after the window is backgrounded:
The solution taken by this PR is to move a blur handler into individual non-touch handlers, so that blur events only reset non-touch events.
The main concern here is that we lose out on a couple things that the
stop
method does:mapbox-gl-js/src/ui/handler_manager.js
Lines 290 to 300 in c13e5ce
Launch Checklist
@mapbox/map-design-team
@mapbox/static-apis
if this PR includes style spec API or visual changes@mapbox/gl-native
if this PR includes shader changes or needs a native portmapbox-gl-js
changelog:<changelog></changelog>