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

[BUG] Dynamic joysticks freezes on fast interaction #151

Open
caiiiycuk opened this issue Sep 29, 2020 · 2 comments
Open

[BUG] Dynamic joysticks freezes on fast interaction #151

caiiiycuk opened this issue Sep 29, 2020 · 2 comments
Labels

Comments

@caiiiycuk
Copy link

Hi.

Describe the bug
Dynamic joysticks freeze at some time if you interact fastly. This bug reproduced on nipple js website.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://yoannmoi.net/nipplejs/
  2. Fast interact with in dynamic mode
  3. You should see some joysticks that are in freeze

Expected behavior
Joysticks should not freeze

Screenshots, Codepen or JSFiddle
Video: https://youtu.be/Rq1NxbSgD0I

Desktop (please complete the following information):

  • Can't reproduce

Smartphone (please complete the following information):

  • Device: [Lenovo Z6]; [Xiaomi Redmi 5A]; [Xiaomi Redmi 7A]; [Xiamoi Mi Max 2]
  • OS: Android
  • Chrome
@caiiiycuk caiiiycuk added the bug label Sep 29, 2020
@caiiiycuk caiiiycuk changed the title [BUG] [BUG] Dynamic joysticks freezes on fast interaction Sep 29, 2020
@caiiiycuk
Copy link
Author

caiiiycuk commented Sep 29, 2020

I found that problem is exactly same as in #94, but for pointer events. Affected devices sometimes does not send pointerremove event. But seems that workaround as for touch events is not possible because we can't get ids of current pointers.

As workaround I switched to "touch" mode for default:

var toBind;
var secondBind = {};
if (isTouch) {
    toBind = events.touch;
    secondBind = events.mouse;
} else if (isPointer) {
    toBind = events.pointer;
} else if (isMSPointer) {
    toBind = events.MSPointer;
} else {
    toBind = events.mouse;
}

This helps. I think it could be good if this order can be configurable. Why pointer is preferred over touch?

caiiiycuk added a commit to caiiiycuk/nipplejs that referenced this issue Sep 29, 2020
caiiiycuk added a commit to caiiiycuk/nipplejs that referenced this issue Oct 5, 2020
caiiiycuk added a commit to caiiiycuk/nipplejs that referenced this issue Oct 5, 2020
@caiiiycuk
Copy link
Author

I found that pointer events works much better then touch events. I added partial workaround for single touch mode it works fine in my case. Please look PR.

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

1 participant