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

Mouse browser navigation (back/forward) doesn't work when cursor is over image viewer #9272

Closed
1 of 3 tasks
Snowknight26 opened this issue May 5, 2024 · 4 comments
Closed
1 of 3 tasks
Labels

Comments

@Snowknight26
Copy link
Contributor

The bug

Viewing an image in the image viewer causes any mouse events that the browser is supposed to handle natively (back/forward bound to mouse4/5 for example) to not fire. This prevents mouse navigation when the cursor is over the image container.

Hovering the cursor over the Info panel, the previous/next image elements, etc., correctly allows navigation.

Only tested Chrome 124 and Firefox 125, and of the two, only Chrome is affected.

The OS that Immich Server is running on

Windows 10 22H2 (19045.4291)

Version of Immich Server

v1.103.1

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

1. Navigate to a photo in Chrome
2. Move the cursor over the image and/or the element that contains the image
3. Press the back navigation button a mouse

Relevant log output

No response

Additional information

Not sure why Firefox isn't affected (maybe it doesn't fire pointerdown events by default) but I think the issue stems from the following:

When the PhotoViewer is rendered, createZoomImageWheel is called.

createZoomImageWheel(imgElement, {

This calls @zoom-image/core's _createZoomImageWheel:
https://github.com/willnguyen1312/zoom-image/blob/5c8bcc09bd1eabb8909d01751bbfaca916f3bfec/packages/svelte/src/useZoomImageWheel.ts#L18

This creates a listener for the pointerdown event here:
https://github.com/willnguyen1312/zoom-image/blob/5c8bcc09bd1eabb8909d01751bbfaca916f3bfec/packages/core/src/createZoomImageWheel.ts#L412

This effectively calls _handlePointerDown here which prevents the default event behavior, which I assume is browser navigation.
https://github.com/willnguyen1312/zoom-image/blob/5c8bcc09bd1eabb8909d01751bbfaca916f3bfec/packages/core/src/createZoomImageWheel.ts#L347

@sierikov
Copy link

sierikov commented May 9, 2024

I tried to take this issue and have found weird behavior. So I can partially reproduce this error. You can see the corresponding testing tables below.

Results for MacOS 14.4.1

Browser Version Works
Firefox 125.0.3
Chrome 124.0.6367.119

So in the MacOS, I can't reproduce the bug in general.

Results for Windows 11 23H2 (22631.3447)

Browser Version Works
Firefox 125.0.2
Chrome 124.0.6367.156
Edge 124.0.2478.80

Results for Linux 6.5.12-1-MANJARO

Browser Version Works
Firefox 125.0.1
Chromium 123.0.6312.122

@Snowknight26
Copy link
Contributor Author

Snowknight26 commented May 9, 2024

I tested on Ubuntu 24 as well and saw the same issue in Chrome.

@sierikov
Copy link

sierikov commented May 9, 2024

I have updated the results. So indeed something in the Chromium-based event.preventDefault is wrong. I'll try to look into this deeper.

@jrasm91 jrasm91 removed the bug label Aug 12, 2024
@danieldietzler
Copy link
Member

Closing this as it seems to be a browser issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants