keep keyboard nav order consistent with visual layout

when adding a menu-item conditionally (i.e. based on a computed boolean), ensure that menu list items are kept in sync with the visual layout of them. this ensures that keyboard navigation is consistent with the visual order of items in the menu.