-
Notifications
You must be signed in to change notification settings - Fork 186
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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') { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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.