Search code examples
javascriptjqueryhtmlmobilepointer-events

Pointer Events method of checking left- or right-click


I've configured Pointer Events through pointerevents-polyfill.

There's an issue I have where I cannot differentiate between left- and right-clicks where right-clicking a nav item will do the same action as left-clicking instead of opening the right-click menu.

The specific event I'm using is pointerup.

Is there a way with Pointer Events to check if the event is a left- or right-click?


Solution

  • I used event.type == 'click' (left) vs. event.type == 'contextmenu' (right).