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

Feature request: dbltap event #64

Open
nolimitdev opened this issue May 5, 2020 · 6 comments
Open

Feature request: dbltap event #64

nolimitdev opened this issue May 5, 2020 · 6 comments

Comments

@nolimitdev
Copy link
Contributor

Event dbltab should be great alternative to native dblclick. Why? Because of native dblclick does not work on iOS. Double tab speed tolerance in ms would be fine to be configurable.

@jerrybendy
Copy link
Owner

Hi @nolimitdev ,

I don't think it's a good idea to support dbltap. Why we use an alternative tap event instead of click? On touch screen devices, when you tap on the screen, the browser doesn't know what you actually want to do, click or dblclick? So that the browser has to wait 300ms to ensure this is a click or a dblclick. This causes a bad user experience and the tap event is focused on solve this issue.

Back to your feature request, if we support dbltap, how could we resolve the conflict between tap and dlbtap?

@nolimitdev
Copy link
Contributor Author

I will reply with question. On desktop browser with mouse how is natively solved difference between click and dblclick? It works well in practice. E.g tap can work normally without change but when there is only dbltab I think there is no problem when user do not use tap. When used both tab and dbltap, only in this case apply needed ms delay to ensure it is dbltap or tap.

@jerrybendy
Copy link
Owner

Yes you are right. I tried this on Chrome, and when bind click and dblclick at same time and double click it, it will trigger 2 clicks and 1 dblclick. The best way to resolve this conflict is do not resolve it 😀

I will consider how to reliaze it. Thanks for your advice.

@nolimitdev
Copy link
Contributor Author

nolimitdev commented May 5, 2020

I agree that no conflict resolving is needed. When user use just dbltab, no problem. In my case Im now using v-on:click and v-on:dblclick and each does something and I never mind that clicks are fired within one dblclick (it is desirable in my case). But dblclick is not supporteted on iOS and by googling users complain about it for long years and have to use different hacks to bypass it. It will be great vue-touch-events solve this shame of Apple.

Btw anyone can simple solve conflict v-on:click/v-on:dblclick or v-touch:tap/v-touch:dbltap by yourself... apply timeout before run click/tab callback, when fired dblclick/dbltap clear timeout and fire just dblclick/dbltap callback. But in my case firing all events is desirable.

@jerrybendy
Copy link
Owner

iOS uses dblclick to zoom in and zoom out. Maybe this is the reason why iOS doesn't support dblclick.

@euan-smith
Copy link

Came here looking for exactly the same feature - I'm implementing a pan/zoom control on an image and want to exactly reproduce the double-tap to zoom in/out which people generally expect, so in this case I will just ignore single tap events so no problem both being fired. I'll work around it, but it would be really nice to have.

I do understand the problem with the delay - this is what the fast-click library was working around, but I think that delay is now gone from browsers (see here) Just firing both and letting the page deal with it is definately the right solution.

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

3 participants