[SOLVED]Issue with pointerup event. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 9

[SOLVED]Issue with pointerup event.

When I use pointerdown and pointerup events they work absolutely fine on desktop. But on mobile browsers it behaves strange. Pointerdown event is okay on mobiles but pointerup event is not. Pointerup event doesn't get triggered if position of pointer is changed, for example if I just touch and don't swipe on screen it works but if I swipe it doesn't get triggered Edit: Magically, re-installing chrome worked!! https://code.sololearn.com/WYnNfat435be/?ref=app

16th Apr 2020, 4:38 PM
Raj Chhatrala
Raj Chhatrala - avatar
6 Answers
16th Apr 2020, 4:51 PM
Gordon
Gordon - avatar
+ 6
For touch screen, the events to listen are touchstart touchmove touchcancel touchend https://code.sololearn.com/WPV6TSGBsLDi/?ref=app
16th Apr 2020, 4:43 PM
Gordon
Gordon - avatar
+ 3
Gordon For some reason touchstart is not working on any browser. I tried writing code with it initially but it didn't work at all so I looked for alternative and I found two mouse events and pointer events. mouse events does not work on mobiles so I tried writing pointer events which works good on desktop but not on mobile.
16th Apr 2020, 4:50 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 3
Gordon that code is working fine on Sololearn but not on Desktop(both Mozilla and chrome) and mobile chrome. 😕🤔
16th Apr 2020, 5:02 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 3
Oh okay, alright. I reinstalled chrome and it seems to be working now. Thanks @Gordon
16th Apr 2020, 5:11 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 2
Pointer up and pointer down events are working ,but I think when you swipe you sure touch screen so that is pointerdown happening but not pointerup since you are just swiping
16th Apr 2020, 4:51 PM
Abhay
Abhay - avatar