instructure / ic-menu

accessible popup menu component
MIT License
45 stars 9 forks source link

Adding conditional menu-item places it at the bottom of arrow order #11

Closed devrieda closed 10 years ago

devrieda commented 10 years ago

When you create menu items where one of the items is conditionally shown, it gets registered last on the list of items in ic-menu-list. This happens even if it appears visually before other items on the list.

This means that when ic-menu-list keyDown is called to focus on the next item, it will skip over this item until it arrives to it at the end of the items list, which is out of order from what appears in the menu.

This is how I have the ic-menu-item conditionally shown.

{{#ic-actions}}
  {{#if somethingIsTrue}}
    {{#ic-menu-item on-select="action1"}}
      Item 1
    {{/ic-menu-item}}
  {{/if}}
  {{#ic-menu-item on-select="action2"}}
    Item 2
  {{/ic-menu-item}}
{{/ic-actions
knomedia commented 10 years ago

I believe this was fixed in 9eb120f815a8bf8357473b9eec57ab64636790fd , and is merged to master, but not yet released.

@rpflorence any plans on when we can release a new version?