Set selected state on items with open submenus.