Mouse click event being fired on right mouse-down AND right mouse-up
It's timing-dependant.

If you click &amp; hold, then mouse-up will activate the currently-selected menu choice, or move outside the menu &amp; release to dismiss.

If you click &amp; immediately let go, it will then stay open waiting for a new click, either on your menu choice, or outside the menu to dismiss.