uwazi icon indicating copy to clipboard operation
uwazi copied to clipboard

Disable wheel zoom on page's embeded maps

Open meegido opened this issue 2 years ago • 4 comments

Describe the bug When user scrolls down the page and one section is the map, the mouse stops in the map, zooming it instead of continue scrolling until the bottom of the page.

To Reproduce Steps to reproduce the behavior:

  1. Go to a custom page, endreprisals.ishr for example.
  2. Scroll down the page.
  3. See error.

Expected behavior When scrolling down the page, even the mouse is inside the map, the user should be able to continue scrolling the page instead of zooming the map. For example, to zoom the map only after click on map.

Screenshots Video link.

Device (please select all that apply)

  • [x] Desktop
  • [x] Mobile

Browser All browsers, mobile and desktop.

Additional context

meegido avatar Jul 13 '22 14:07 meegido

Maybe @juanmnl could give better advice for the interaction :)

meegido avatar Jul 13 '22 14:07 meegido

@meegido I think this one revolves around the question of what is a good default for the map. In my opinion generally speaking the mouse wheel shouldn't react over the map in most cases by default. But in that case we also need to add the zoom +/- buttons by default.

txau avatar Jul 13 '22 15:07 txau

@meegido @txau I think there are 2 different issues here, the first is blocking the default map interaction on a scrolling site, when the map is just a section of the website/page. One possible solution for this is either have a 1 or 2 seconds delay on hover, where you block the default behavior until the cursor is stopped over the map and we infer that the user wants to explore it. Another option is to have an explicit action (maybe an overlay with [explore map] action that triggers the default interaction.

For a full page, that is only a map, the default behavior shouldn't be a problem, but for users who don't want it, we could have a [disable/enable wheel behavior] toggle.

Hope I understood well 🫠

juanmnl avatar Jul 14 '22 14:07 juanmnl

Sorry for not being attentive to the GitHub comments.

I'm removing the option to zoom in on the map with CSS. That way, users can still click on the entities (the sidebar opens) but not zoom into the map and get trapped into the map when the design requires it to be full width. From my perspective, @txau's suggestion is the more straightforward option.

meegido avatar Apr 30 '24 12:04 meegido