Skip to content

fix: isPressed will return value expectedly on iOS13#123

Closed
umeruma wants to merge 5 commits into
yoannmoinet:masterfrom
umeruma:features/fix-pointer-event
Closed

fix: isPressed will return value expectedly on iOS13#123
umeruma wants to merge 5 commits into
yoannmoinet:masterfrom
umeruma:features/fix-pointer-event

Conversation

@umeruma
Copy link
Copy Markdown

@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
Copy Markdown
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.

Comment thread src/utils.js
};

export const isPressed = (evt) => {
if (evt.type === 'pointerdown' || evt.type === 'pointermove') {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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