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

Momentum scrolling seems instant on MacOS with reduced motion #2238

Closed
joepio opened this issue Mar 1, 2023 · 4 comments
Closed

Momentum scrolling seems instant on MacOS with reduced motion #2238

joepio opened this issue Mar 1, 2023 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers need more info Further information is requested

Comments

@joepio
Copy link

joepio commented Mar 1, 2023

maplibre-gl-js version: 2.4.0 (also posted this on MapBoxGL)

browser: Chrome, safari (on MacOS)

Steps to Trigger Behavior

  1. Turn on reduced motion on macOS accessibility settings
  2. Open a map on MacOS (e.g. https://maplibre.org/)
  3. Drag over the map with the mouse, let go while making the dragging motion (don't wait with letting go until movement has stopped)
  4. You will see the map skips over an area, dependent on your speed (see video below)

Link to Demonstration

Note how the map instantly teleports to a new location when the cursor changes from 'dragging' to 'normal'.

maplibre.mov

Expected Behavior

There are two ways dragging and letting go while having momentum should work:

  1. Freeze the position when the mouse button is let go.
  2. Momentum scrolling, even when reduced motion is on.

Actual Behavior

Map 'teleports' to position further then where the mouse is let go. I suspect that it instantly teleports to the calculated 'momentum' position (where it should come to a stop), but the animation is 0ms long. But this is just a guess coming from someone who doesn't know the internals of course.

@joepio joepio changed the title Momentum scrolling seems instant on MacOS Momentum scrolling seems instant on MacOS with reduced motion Mar 1, 2023
@HarelM
Copy link
Collaborator

HarelM commented Mar 2, 2023

I don't think maplibre has versions 2.12, 2.13...
Can you clarify the following please:
"Turn on reduced motion on macOS accessibility settings"?
Can this be tested using the following media query?
https://a11y-101.com/development/reduced-motion#:~:text=On%20a%20Mac%20you%20go,turn%20on%22Reduce%20Motion%22.

@HarelM HarelM added bug Something isn't working good first issue Good for newcomers need more info Further information is requested labels Mar 2, 2023
@joepio
Copy link
Author

joepio commented Mar 2, 2023

@HarelM

I don't think maplibre has versions 2.12, 2.13...

You're right, it's the latest version (if that's the one on maplibre.org).

Can you clarify the following please: "Turn on reduced motion on macOS accessibility settings"?

On a mac, go to accessibility settings, then to display then tick reduce motion

Can this be tested using the following media query?

And not sure what you mean with can this be tested?

Anyways, I'm pretty sure this is the culprit:

if (!options.essential && browser.prefersReducedMotion) {

@HarelM
Copy link
Collaborator

HarelM commented Mar 2, 2023

You're probably right, feel free to sumbit a PR that fixes this if you have a good idea how to solve this.

@HarelM
Copy link
Collaborator

HarelM commented Nov 19, 2023

Fixed by #3068.

@HarelM HarelM closed this as completed Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants