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

Pb with gesture and video on Chrome #996

Open
stalb opened this issue Feb 17, 2023 · 2 comments
Open

Pb with gesture and video on Chrome #996

stalb opened this issue Feb 17, 2023 · 2 comments

Comments

@stalb
Copy link

stalb commented Feb 17, 2023

If I use gesturable on elements that embed a video, using the video controls interacts with gesturable actions.

Expected behavior

I should be able to use gesturable on an element that embeds a video and use the video controls.

Actual behavior

If I touch a video control (play/pause, etc.) then I can init a two-fingers gesture with only one finger (the other touch point is the video control).

Remark: I have this problem with Chrome (everything works well with Firefox).

System configuration

interact.js version: 1.10.17
Browser name and version: Chrome 110.0.5481.104 (64 bits)
Operating System: windows 10

Minimal example to reproduce the problem:

How to reproduce the problem:

  • load the page,
  • touch one of the video controls (play/pause/mute/unmute, etc.)
  • touch the red part with one finger and move it, interactjs interprets that as a two-fingers gesture.
@stalb
Copy link
Author

stalb commented Feb 17, 2023

The bug seems to have been introduced with version v1.3.0.

@nitzanrh
Copy link

Hi @stalb,

I had a similar bug and managed to get around it.

TLDR: create a child element that has no child elements and is the same size and position as your gesturable element, then attach the gesture listener to it instead of the original gesturable element.

Basically I experienced the same behaviour you do, ie managing to initiate a pinch gesture with only one finger.
After some debugging it appears that an event's "touch" persisted through different touches, ie the event contained two Touches instead of one. The 'persistent' touch had the same ID, regardless how many times I used one finger.

After consulting chatGPT, it suggested that perhaps a child element is 'firing' the same event touch over and over again. So by attaching the Gesturable listener to a child element that has the same position and size as the original gesturable element AND has no other child elements (basically a random DIV with some CSS for position, height and width) I managed to get around this issue.

Please let me know if this helped you :)

Cheers,
Nitzan

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