Skip to content

Support for touch events? #48

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

Closed
DSheffield opened this issue Mar 14, 2019 · 9 comments
Closed

Support for touch events? #48

DSheffield opened this issue Mar 14, 2019 · 9 comments
Labels

Comments

@DSheffield
Copy link

Is there any plan to support touch events as well? So click outside could effectively be click or touch outside?

@zeppelin
Copy link
Owner

@DSheffield It does work on mobile devices - if that's what you're asking. Is there a specific reason you need touch events?

@DSheffield
Copy link
Author

DSheffield commented Mar 14, 2019

I see from your simple demo app it does seem to work with touch (or at least the corresponding mouse events the browser sends when touches occur). We've used the addon in our app and it seemed it wasn't invoking the clickOutside action in response to touch events. But, maybe we've done something that's interfering with the events. I'll check into that a bit further.

We need touch events cause our app is kinda positioned as touch based - but we're using touch screen laptops (not phones / ipads, etc).

@DSheffield
Copy link
Author

So, here's an example of what we're looking to support. A simple touch / release triggers the action. A touch / swipe, however, does not:

touchOutside1

But a similar drag with the mouse does trigger the action:

clickOutside1

@zeppelin
Copy link
Owner

So you need the same click behavior on touch-based devices?

@DSheffield
Copy link
Author

Yeah, effectively I want the clickOutside action to be triggered any time there's any kind of touch interaction not within my component.

@zeppelin
Copy link
Owner

To be honest I did not have such goals :) Nevertheless, if you have working fork supporting this -and it does fit into the original addon's API- I'm happy to pull the changes to upstream!

@DSheffield
Copy link
Author

What is your browser / version support goal?

@zeppelin
Copy link
Owner

It's not quite about browser support per se. The way I think about this is more of how mobile browsers are handling these interactions with the current version. They do support clicks on elements, so the current behavior is not buggy. That said, if there was a setting, like <ClickOutside @useTouchEvents={{true}} ...>, it'd be a different story. I haven't planned adding these sort of stuff to the feature set myself. But, like I mentioned, I'm open to such contributions - it's only that it shouldn't break existing behavior. If that's the case, I'm cool with it!

@zeppelin
Copy link
Owner

zeppelin commented Oct 1, 2019

@DSheffield Can be achieved with #51

@zeppelin zeppelin closed this as completed Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants