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]Joystick Becomes Stuck at Maximum Extents When Right Clicking Outside Document #130

Open
rowlowles opened this issue Jan 8, 2020 · 1 comment
Labels

Comments

@rowlowles
Copy link
Contributor

Describe the bug
The joystick can become stuck if you right click outside your document.

To Reproduce
Reproduced using the demo provided.

  1. Go to https://codepen.io/YoannM/pen/gapmMG (Easiest to reproduce if this is a windowed browser)
  2. Click anywhere on the demo to create the joystick
  3. Drag your mouse outside the bounds of the browser and right click. Click anywhere outside the browser to close the right click menu.
    4. The joystick remains in the position it was before I right clicked outside the window. Moving the mouse outside the browser window or clicking outside the window have no effects.
    5. Moving the mouse back into the browser field results in the nipple tracking the mouse even though I am not clicking or holding any mouse buttons.

Expected behaviour
I expected that once I clicked outside the browser and the page lost focus, the joystick would reset to it's resting position. Furthermore, I would expect that the nipple should not track the mouse when the mouse is not held down. Additionally, it would be desirable that if the cursor left the document the nipple could reset to its resting position.

Screenshots, Codepen or JSFiddle
Reproduced in this the provided Codepen with no changes made to the code.
Gif of the bug:
nippleBugExtents

Desktop (please complete the following information):

  • OS: Ubuntu 16.04 LTS (64 bit)
  • Browser Chrome
  • Version: 77.0.3865.120

Additional context
This bug was found on version 0.8.4 of Nipple.

@rowlowles rowlowles added the bug label Jan 8, 2020
@fedemarino31
Copy link

The same happens on mobile when you pull down the iOS menu or switch to other app. The joystick stays blocked
I was able to fix it with a patch.
I listen to the "touchcancel" event on the document body and I re-setup the joysticks
But probably, in nipplejs source code, the event.end should be triggered on touchcancel

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