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

[BUG] [Web-Mobile] [BUG] Making SVG-Elements Clickable (disable onTouch preventDefault) makes pan on mobile-dimensions laggy #299

Open
folsze opened this issue Mar 21, 2023 · 2 comments

Comments

@folsze
Copy link

folsze commented Mar 21, 2023

It only happens on Broswer (for me with Google Chrome) with dimensions: "responsive" as mobile and with
width: 460
height: 840
see here:
image

Here is the repo:
https://github.com/folsze/panzoom-bug

Making SVG-Elements Clickable (disable onTouch preventDefault) makes the pan laggy.

Comment those three lines in/out:
image

Here are two GIFs demonstrating a version with fluid pan and a version with laggy pan:
EDIT: I HAD TO COMPRESS THE GIFS. THE FRAMERATE DROPPED AND NOW THE VIDEOS ARE indistinguishable.
for full quality videos go here:
https://wetransfer.com/downloads/469ce025134302e278df4151ca4a64c820230321115451/765cca07f22f5aed3cfe8680e52149cf20230321115548/b12c39

Fluid/smooth:
ezgif-4-b33aae7590

Laggy:
ezgif-4-acb61ce2fe

I think it is similar but unrelated to your comment on (https://github.com/anvaka/panzoom#handling-touch-events):
"make sure you test the page behavior on iOS devices. Sometimes this may cause page to bounce undesirably."

Can we ignore this since it only happens on web with those small dimensions? No, because:
It is reproducible on the android studio emulator (Pixel 33 XL API)

(Could not test on real mobile device yet since I have the combo of IOS+Non-MacOS. Will update here once tested.)

NOTE:
thus far this is the only thing that is holding me back from susing this library.
Otherwise I would use timmywil/panzoom but it also has a (less bad) "bug/hinderance" that is holding me back:
timmywil/panzoom#643

@folsze folsze changed the title [Web-Mobile] Making SVG-Elements Clickable (disable onTouch preventDefault) makes pan on mobile-dimensions laggy [BUG] [Web-Mobile] [BUG] Making SVG-Elements Clickable (disable onTouch preventDefault) makes pan on mobile-dimensions laggy Mar 21, 2023
@folsze
Copy link
Author

folsze commented Mar 30, 2023

tested on native IOS device - still very slow behaviour - not able to use this for a real app. Does anyone else have this or is it just with this project? Even the svg file size is fairly small.

@jannis6023
Copy link

Same problem. setting onTouch to false makes me able to click the elements, but makes everything extremely laggy;
onClick makes it fluent, but not clickable...
Not really well usable for me!

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