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

Swipe event not working with touch screen in Microsoft Edge. #170

Open
toshiya14 opened this issue Mar 5, 2021 · 4 comments
Open

Swipe event not working with touch screen in Microsoft Edge. #170

toshiya14 opened this issue Mar 5, 2021 · 4 comments
Assignees
Labels
awaiting-feedback The issue requires more feedback from the original poster. investigating The developer is currently investigating the cause or solution to this issue.

Comments

@toshiya14
Copy link

My User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36 Edg/89.0.774.45

Issue Description: I use your library in my project, the swipeleft and swiperight event not triggered in my project with touch screen in Microsoft Edge, but the touch gesture function of the browser happens.
I have also tried your Demo, the behavior is the same.
It is the same issue if I use Chrome with a real touch screen.

I have tried to add $([the same selector]).on("touchstart", e => { e.preventDefault(); } to my page, the touch gesture is not triggered any more. But the swipe related events not response as well.

It works fine with mouse operation and F12 mouse emulated touch operation. But not works with a real touch screen.

@benmajor
Copy link
Owner

benmajor commented Mar 5, 2021

Are you saying that even calling on('touchstart') does not trigger anything?

I would imagine that it's related to #166. What is the physical device that you are trying on?

@benmajor benmajor self-assigned this Mar 5, 2021
@benmajor benmajor added awaiting-feedback The issue requires more feedback from the original poster. investigating The developer is currently investigating the cause or solution to this issue. labels Mar 5, 2021
@toshiya14
Copy link
Author

Are you saying that even calling on('touchstart') does not trigger anything?

I would imagine that it's related to #166. What is the physical device that you are trying on?

I am using a monitor with touch support via USB to my desktop. I think it would use the common touch driver just like a Windows tablet such as Microsoft Surface Pro.

@toshiya14
Copy link
Author

I have tried to fix the problems and write the events by myself.
And this version does work.

https://codepen.io/toshiya14/pen/PobBywd

  • Use e.preventDefault() in on(touchstart) and then process the logic seems work fine.
  • If I do not add style touch-action: none, I got an Error: Unable to preventDefault inside passive event listener due to target being treated as passive.
  • Add e.preventDefault() to on(touchend) might prevent the mouse events.

I hope this codes might help to fix this issue.

@benmajor
Copy link
Owner

benmajor commented Mar 5, 2021

Okay, thanks. I will take a look at the differences and see what the possible issue is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-feedback The issue requires more feedback from the original poster. investigating The developer is currently investigating the cause or solution to this issue.
Projects
None yet
Development

No branches or pull requests

2 participants