Fix menu not auto-closing on item click + not closing on ESC + sometimes triggering item action even when closed

@gaurave