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

[Feat] Add an option to turn it on/off #1

Closed
dmytro-shchurov opened this issue Jul 23, 2021 · 2 comments
Closed

[Feat] Add an option to turn it on/off #1

dmytro-shchurov opened this issue Jul 23, 2021 · 2 comments

Comments

@dmytro-shchurov
Copy link

dmytro-shchurov commented Jul 23, 2021

If this library is going to be used in a hybrid application (like Electron for SBC) or on a typical web site, browser handling of swiping will confuse user a lot imho.
What I see as an option, is to touch and hold waiting for some time until a recognition mode is turned on (with a custom timer and calling to the missed method). At the same moment scrolling can be disabled also.
This will allow to avoid false triggering while user scrolls.

UPD I wonder is .stopListen() lightweight enough to use it as on/off?

@fakt309
Copy link
Owner

fakt309 commented Jul 23, 2021

dmytro-shchurov, thanks for feedback. It is very useful issue. I'll think about swiping and how to avoid collisions with third-party apps. What about .stopListen() this is pretty lightweight method. Since it only calls the function three times .removeEventListener(), to clear object events on "touchstart", "touchend", "touchmove". But if you want to turn on again, you need to call .listen(DOMOBJECT)

@dmytro-shchurov
Copy link
Author

Thank you very much for the explanations. I think this is what I meant.
I'd like to test your library in Electron application on Raspberry Pi (a music player) and let you know if any issues will be found. I believe it will be pretty useful there on 5" screen.

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