Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

In the typeahead directive, the selected option should be marked with aria-selected="true" #5233

Closed
Codermar opened this issue Jan 13, 2016 · 2 comments

Comments

@Codermar
Copy link

In the typeahead directive, the selected option should be marked with aria-selected="true" in addition to marking the aria-activedescendant to its parent. The following code would do that: (about line 193)

    // Indicate that the specified match is the active (pre-selected) item in the list owned by this typeahead.
    // This attribute is added or removed automatically when the `activeIdx` changes.
    scope.$watch('activeIdx', function(index) {
      if (index < 0) {
        element.removeAttr('aria-activedescendant');
      } else {
          angular.element('#' + popupId + ' li[aria-selected="true"]').attr('aria-selected', false);
          // set the aria-selected attribute
          angular.element('#' + getMatchId(index)).attr('aria-selected', true);
          element.attr('aria-activedescendant', getMatchId(index));
      }
    });
@icfantv
Copy link
Contributor

icfantv commented Jan 13, 2016

@Codermar, the aria items are being tracked in #4772 for the 1.1 release.

@icfantv icfantv closed this as completed Jan 13, 2016
@icfantv
Copy link
Contributor

icfantv commented Jan 13, 2016

I should note that by linking that issue here - it will show up in #4772's feed so, in theory, it shouldn't be missed. Thanks for the callout.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants