angular-ui / ui-select

AngularJS-native version of Select2 and Selectize
MIT License
3.26k stars 1.82k forks source link

Impossible to select first item by screen reader #2000

Open k7sleeper opened 7 years ago

k7sleeper commented 7 years ago

It's impossible to select the first item using the sr. Fix: In select.jschange

$scope.$watch('$select.activeIndex', function(activeIndex) {
  if (activeIndex)
    $element.find('input').attr(
      'aria-activedescendant',
      'ui-select-choices-row-' + ctrl.generatedId + '-' + activeIndex);
});

to

$scope.$watch('$select.activeIndex', function(activeIndex) {
  if (activeIndex != null)
    $element.find('input').attr(
      'aria-activedescendant',
      'ui-select-choices-row-' + ctrl.generatedId + '-' + activeIndex);
});
Jefiozie commented 7 years ago

Hi,

As described in the issue template we would like to have a full description with plunker and version. In the case we can have a look at the issue and reproduce the issue much quicker.

Please update your issue as requested in the issue template.

The issues forum is NOT for support requests. It is for bugs and feature requests only. Please read https://github.com/angular-ui/ui-select/blob/master/CONTRIBUTING.md and search existing issues (both open and closed) prior to opening any new issue and ensure you follow the instructions therein.

Bug description:

Link to minimally-working plunker that reproduces the issue:

Version of Angular, UI-Select, and Bootstrap/Select2/Selectize CSS

Angular: UI-Select: Bootstrap/Select2/Selectize CSS (if applicable):

Thanks :smile:j

toolchild commented 7 years ago

Hi there,

The issue described can be reproduced in this example: http://angular-ui.github.io/ui-select/demo-append-to-body.html

I tested it with NVDA Version 2017.2 which is the newest version at the moment. https://www.nvaccess.org/ I tested the Select2 theme dropdown I tested it using Chrome Version 59.0.3071.115 (Official Build) (64-Bit)

Steps to reproduce:

I also applied the proposed fix (line 1023). It fixed part of the issue. http://plnkr.co/edit/5JS3Rh4C4MllBXVQxQoZ?p=preview

This proposed fix makes it possible to select Adam, which is currently impossible.