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

fix: isPressed will return value expectedly on iOS13 #123

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

umeruma
Copy link

@umeruma umeruma commented Oct 2, 2019

fixes #122

The JoyPad cannot be moved on iOS 13 Safari, because of Pointer Event API that added.
https://developer.apple.com/documentation/safari_release_notes/safari_13_release_notes

Strangely, the JoyPad works fine on iOS 13 on this demo page https://yoannmoi.net/nipplejs/.
Although this fix has confirmed the expected behavior on iOS 13 Safari, it may not be a fundamental solution to the cause of this bug.

Copy link
Owner

@yoannmoinet yoannmoinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton for this.
I have a single comment.

@@ -33,6 +33,9 @@ export const degrees = (a) => {
};

export const isPressed = (evt) => {
if (evt.type === 'pointerdown' || evt.type === 'pointermove') {
Copy link
Owner

@yoannmoinet yoannmoinet Oct 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have a evt.type === 'pointerdown' here? I don't see it.

Also, following that logic, maybe it will be the same for touchstart and touchmove?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late reply. When I tested with iPhone 11, I have confirmed 'pointerdown' event through here.
However, I think this is not fundamental solution, is just workaround.
So could I close this PR?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't close it, I think this is a good solution.
I'll take over if you don't have time for this, no worries.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I got it.
I don't have enough time for debugging this now.

I'm working on some game project with nipplejs, and I got another bug with iOS 13 on iPhone SE: Sometimes joypad will not be destroyed, remains show up without disappearing even if I lift up my finger.

So I fork this, and I'm using this branch code.
umeruma@3be8638

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

Successfully merging this pull request may close these issues.

[BUG] Joystick is unresponsive when using pixi.js and iOS 13
4 participants