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

Zooming doesn't work in Safari browser #35

Open
SerovMihail opened this issue Oct 12, 2022 · 8 comments
Open

Zooming doesn't work in Safari browser #35

SerovMihail opened this issue Oct 12, 2022 · 8 comments

Comments

@SerovMihail
Copy link

SerovMihail commented Oct 12, 2022

Are you reporting a bug?

Basic example is relevant and bug could be reproduced -> https://codesandbox.io/s/svelte-easy-crop-basic-demo-q1005?file=/App.svelte. Also reproduces on react-easy-crop basic example.

Env:

  • Safari version -> Version 15.6.1 (17613.3.9.1.16)
  • macOS Montrey 12.5.1 (21G83)

Provide the steps to reproduce the issue, e.g.:

  • Open sandbox
  • Try to pinch by two fingers. I'm using a laptop touchpad for it mouse wheel, behaviour is same

Expected behaviour

Pinch works correctly in Safari

@ValentinH
Copy link
Owner

ValentinH commented Oct 12, 2022

Does it work on another macOS browser?

@SerovMihail
Copy link
Author

Yes, I asked my colleague, he uses macos catalina and safari version is 14.0. Bug reproduced.

@ValentinH
Copy link
Owner

I meant on a non-safari browser on macOS like Chrome. I tried it kinda work even though it doesn't feel natural.

I don't know if there is a way to listen to this gesture on safari.

@ValentinH
Copy link
Owner

Ok this is probably this one that should be handled: https://developer.mozilla.org/en-US/docs/Web/API/Element/gesturechange_event

Today, we simply prevent the default.

@ValentinH
Copy link
Owner

I fixed this in the react version a few minutes ago: ValentinH/react-easy-crop#414

Would you be interested in adding the same to this svelte version? I haven't touched Svelte for years 🙈

@SerovMihail
Copy link
Author

Don't you think that the math of the zooming algorithm is wrong? I don't know why but all versions higher than 4.6.0 can zoom but the destination point is wrong; I mean i get stuck in corner every time i try to zoom center of the image, no matter where and how I pitch on my touchpad zooming always behave like this.

Attaching video to show how it works

Screen.Recording.2022-10-14.at.22.23.31.mov

@ValentinH
Copy link
Owner

I actually noticed this as well but it's only on codesandbox and using safari if I'm not mistaken. Therefore, it's probably due to iframes and the gesture client X/Y not being correct. I'll have to investigate...

So you confirm your video is taken on Safari?

@SerovMihail
Copy link
Author

SerovMihail commented Oct 16, 2022

So you confirm your video is taken on Safari?

Yes, the video was taken from safari

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

No branches or pull requests

2 participants