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

Static/semi mode on touch devices creates new nipples or are not dragable #16

Closed
andersHj opened this issue Nov 2, 2015 · 13 comments · Fixed by #18
Closed

Static/semi mode on touch devices creates new nipples or are not dragable #16

andersHj opened this issue Nov 2, 2015 · 13 comments · Fixed by #18
Assignees
Labels

Comments

@andersHj
Copy link

andersHj commented Nov 2, 2015

Very cool library, but have some issues on touch devices in static and semi mode

image1
On Ipad Air 2, new instances will be created on each touch also in static and semi mode.

On Sony Z2 Tab, most of the time it will not create a new instance, but often the existing instance is not working/dragable (this could be reproduced in chrome developer console by using touch device mode).

@yoannmoinet
Copy link
Owner

Thanks a lot for this.
I'll look into it soon enough.

@yoannmoinet yoannmoinet added the bug label Nov 2, 2015
@yoannmoinet yoannmoinet self-assigned this Nov 2, 2015
@blq
Copy link

blq commented Nov 6, 2015

Also noticed this.
Seems like the identifier id collides, resulting in multiple instances of "nipple_0" etc causing great DOM confusion.

@yoannmoinet
Copy link
Owner

This should have been fixed in 0.5.4
Can you confirm it?

@blq
Copy link

blq commented Nov 8, 2015

No. When I create two static nipples they both get id=0. My case is a simple gamepad style setup. Two simultaneous touches and zombie clones occur.
Line #639 "mode == 'static'" seems to always pass identifier as 0?

@yoannmoinet
Copy link
Owner

Indeed, there is still a nasty bug... once again with multitouch 😞

It looks like it's because of listening / stop listening to events that is somehow un-sync with the mode in use.

Working on it.

@yoannmoinet
Copy link
Owner

0.5.6 should be better with multi-touch.

@blq
Copy link

blq commented Nov 9, 2015

Slightly better, no clones appear. But still, the id is duplicated to 0. When touching both one locks up and freezes. I believe this is a bug in the "static" mode?

As said, isn't a good use-case a gamepad setup? Two side-by-side containers with one static-mode nipple-joystick in each.

@yoannmoinet
Copy link
Owner

Can you show me some code sample so I can reproduce your setup?

@blq
Copy link

blq commented Nov 9, 2015

var joystickL = nipplejs.create({
    zone: document.getElementById('left-pad'),
    mode: 'static',
    position: { left: '20%', top: '50%' },
    color: 'green',
    size: 200
});

var joystickR = nipplejs.create({
    zone: document.getElementById('right-pad'),
    mode: 'static',
    position: { left: '80%', top: '50%' },
    color: 'red',
    size: 200
});

@yoannmoinet
Copy link
Owner

Thanks, I'm looking into this... for sure there is a problem with the lib.
In theory it should have worked.
But it obviously doesn't. I think I have to refactor some stuff.
I'll keep this thread updated.

@blq
Copy link

blq commented Nov 9, 2015

Great, thanks!

@andersHj
Copy link
Author

Thank you for fast fix!
It now works for my use case on Ipad.
Would be great if it worked with several instances as well.

@yoannmoinet
Copy link
Owner

Please note that there is an opened issue for the multi-instance problem #20.

@yoannmoinet yoannmoinet mentioned this issue Nov 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants