Re-query selection state in onContextMenu

Issue #2369