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

When oneFingerPan is true clicks on SVG elements are not working anymore #93

Open
meriturva opened this issue Dec 20, 2021 · 13 comments
Open

Comments

@meriturva
Copy link

meriturva commented Dec 20, 2021

is it possible to enable oneFingerPan and still receive mouse events from SVG elements?

Thanks

@Fuzzyma
Copy link
Member

Fuzzyma commented Dec 20, 2021

Mh, this is not that easy to solve. Some people want to be able to pan even if you "start" the pan on an element. You however dont want panning on elements. I am not really sure how to satisfy both

@meriturva
Copy link
Author

I guess the only way is a sort of timeout handling and move difference between mouseDown and mouseUp event. What do you think?

@Fuzzyma
Copy link
Member

Fuzzyma commented Dec 20, 2021

That will complicate the code quite a bit and timeouts are really sensitive to race conditions and stuff not behaving the same all the time. Thats why I avoid them. btw: what mouse events exactly are not working for elements anymore? Afaik, we don't stop Propagation and only prevent default for touch down

@meriturva
Copy link
Author

Seems to be blocked globally, I could prepare a simple repo to play with.....what do you think?

@Fuzzyma
Copy link
Member

Fuzzyma commented Dec 20, 2021

sure there is no harm in playing around and finding better solutions

@meriturva
Copy link
Author

Here a simple stackblitz with oneFingerPan enabled: https://stackblitz.com/edit/js-ulebap?file=index.html

Please use a touch screen or a device to test click.

As you could see there is no way to make click works on the top black dot.

@Fuzzyma
Copy link
Member

Fuzzyma commented Dec 20, 2021

Works for me when doing this:

  SVG('#pointB').on('click', () => {
    console.log('test');
  });

@meriturva
Copy link
Author

meriturva commented Dec 20, 2021

Thanks @Fuzzyma for your time but when I try your sample on my touch screen I have the same issue. Did you try on a touch device? if yes on a desktop touch display or mobile one?

@Fuzzyma
Copy link
Member

Fuzzyma commented Dec 20, 2021

No. I only tried on my laptop. You can try touchstart as well tho. Sorry, I cant spend much time to figure this out atm.

@dmitriyzhuk
Copy link

@meriturva got the same issue. found any solution for this?

@meriturva
Copy link
Author

@meriturva got the same issue. found any solution for this?

No actually

@Quasarman
Copy link

Have the same issue is there a proper solution for this?

@phrei
Copy link

phrei commented Sep 13, 2023

Would be nice if a threshold could be configured. Something like "if I drag my finger for 5px, then it starts to pan, otherwise it's a click".

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

5 participants