Allow context menu to be closed even in disabled mode

Without this change, if disabling the menu is triggered by selecting one of the options in the menu, it will stay open and won't close on click nor on escape.