Allow to close a context menu with ESC key (#11869)

Change-Id: I4d19b6a385770204bb732893534efb6b62dea19a