How do you setup the right click in mobile. | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 5

How do you setup the right click in mobile.

I want to add right click on my code but how do I do it on a mobile interface and how to add it .

19th Oct 2017, 12:56 PM
Prakshenjay Bhati
Prakshenjay Bhati - avatar
1 Antwort
+ 6
Right click doesn't have any sense i a touch device context... however, right click behaviour is mostly emulated by a long press, but long press is also mostly used as text selection: so, you need to desactivate user text selection on elements wich you want to handle the long press. Anyway, touch events are very basic in web context, and there no built-in "long press" event: you need to implement it (by yourself or through use of a framework) using "touchstart" and "touchend" events, and react if time before finger release is enough ^^
19th Oct 2017, 2:25 PM
visph
visph - avatar