In JavaScript, how to listen to a pointerUp event from the right mouse button while the left mouse button is held down?

How to listen to pointerUp event from a different mouse button when a mouse button is pressed down?

Im trying to listen to pointerUp event from right mouse button while the left mouse button is held down. For some reason when any mouse button is held down subsequent pointer down events from any other mouse buttons are not triggering pointerUp events, is there a workaround for this issue?

Thanks for the help in advance 🙂