This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +28
-11
lines changed Expand file tree Collapse file tree 4 files changed +28
-11
lines changed Original file line number Diff line number Diff line change 84
84
} ;
85
85
}
86
86
87
+ var latestId = 0 ;
87
88
angular . module ( 'ui.select' , [ ] )
88
89
89
90
. constant ( 'uiSelectConfig' , {
90
91
theme : 'bootstrap' ,
91
92
searchEnabled : true ,
92
93
placeholder : '' , // Empty by default, like HTML tag <select>
93
94
refreshDelay : 1000 , // In milliseconds
94
- closeOnSelect : true
95
+ closeOnSelect : true ,
96
+ generateId : function ( ) {
97
+ return latestId ++ ;
98
+ }
95
99
} )
96
100
97
101
// See Rename minErr and make it accessible from outside https://github.com/angular/angular.js/issues/6913
892
896
893
897
var searchInput = element . querySelectorAll ( 'input.ui-select-search' ) ;
894
898
899
+ $select . generatedId = uiSelectConfig . generateId ( ) ;
900
+ $select . ariaLabel = attrs . title ;
895
901
$select . multiple = angular . isDefined ( attrs . multiple ) && (
896
902
attrs . multiple === '' ||
897
903
attrs . multiple . toLowerCase ( ) === 'multiple' ||
Original file line number Diff line number Diff line change 1
1
< ul class ="ui-select-choices ui-select-choices-content select2-results ">
2
2
< li class ="ui-select-choices-group " ng-class ="{'select2-result-with-children': $select.choiceGrouped($group) } ">
3
3
< div ng-show ="$select.choiceGrouped($group) " class ="ui-select-choices-group-label select2-result-label " ng-bind-html ="$group.name "> </ div >
4
- < ul ng-class ="{'select2-result-sub': $select.choiceGrouped($group), 'select2-result-single': !$select.choiceGrouped($group) } ">
5
- < li class ="ui-select-choices-row " ng-class ="{'select2-highlighted': $select.isActive(this), 'select2-disabled': $select.isDisabled(this)} ">
4
+ < ul role ="listbox "
5
+ id ="ui-select-choices-{{ $select.generatedId }} " ng-class ="{'select2-result-sub': $select.choiceGrouped($group), 'select2-result-single': !$select.choiceGrouped($group) } ">
6
+ < li role ="option " id ="ui-select-choices-row-{{ $select.generatedId }}-{{$index}} " class ="ui-select-choices-row " ng-class ="{'select2-highlighted': $select.isActive(this), 'select2-disabled': $select.isDisabled(this)} ">
6
7
< div class ="select2-result-label ui-select-choices-row-inner "> </ div >
7
8
</ li >
8
9
</ ul >
Original file line number Diff line number Diff line change 4
4
< ul class ="select2-choices ">
5
5
< span class ="ui-select-match "> </ span >
6
6
< li class ="select2-search-field ">
7
- < input
8
- type ="text "
9
- autocomplete ="off "
10
- autocorrect ="off "
11
- autocapitalize ="off "
12
- spellcheck ="false "
13
- class ="select2-input ui-select-search "
7
+ < input
8
+ type ="text "
9
+ autocomplete ="off "
10
+ autocorrect ="off "
11
+ autocapitalize ="off "
12
+ spellcheck ="false "
13
+ role ="combobox "
14
+ aria-expanded ="true "
15
+ aria-owns ="ui-select-choices-{{ $select.generatedId }} "
16
+ aria-label ="{{ $select.ariaLabel }} "
17
+ aria-activedescendant ="ui-select-choices-row-{{ $select.generatedId }}-{{ $select.activeIndex }} "
18
+ class ="select2-input ui-select-search "
14
19
placeholder ="{{$select.getPlaceholder()}} "
15
20
ng-disabled ="$select.disabled "
16
21
ng-hide ="$select.disabled "
Original file line number Diff line number Diff line change 1
1
< div class ="ui-select-container select2 select2-container "
2
2
ng-class ="{'select2-container-active select2-dropdown-open open': $select.open,
3
3
'select2-container-disabled': $select.disabled,
4
- 'select2-container-active': $select.focus,
4
+ 'select2-container-active': $select.focus,
5
5
'select2-allowclear': $select.allowClear && !$select.isEmpty()} ">
6
6
< div class ="ui-select-match "> </ div >
7
7
< div class ="select2-drop select2-with-searchbox select2-drop-active "
8
8
ng-class ="{'select2-display-none': !$select.open} ">
9
9
< div class ="select2-search " ng-show ="$select.searchEnabled ">
10
10
< input type ="text " autocomplete ="off " autocorrect ="off " autocapitalize ="off " spellcheck ="false "
11
+ role ="combobox "
12
+ aria-expanded ="true "
13
+ aria-owns ="ui-select-choices-{{ $select.generatedId }} "
14
+ aria-label ="{{ $select.ariaLabel }} "
15
+ aria-activedescendant ="ui-select-choices-row-{{ $select.generatedId }}-{{ $select.activeIndex }} "
11
16
class ="ui-select-search select2-input "
12
17
ng-model ="$select.search ">
13
18
</ div >
You can’t perform that action at this time.
0 commit comments