File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 8
8
9
9
dd . run ( [ '$templateCache' , function ( $templateCache ) {
10
10
$templateCache . put ( 'ngDropdowns/templates/dropdownSelect.html' , [
11
- '<div ng-class="{\'disabled\': dropdownDisabled}" class="wrap-dd-select">' ,
11
+ '<div ng-class="{\'disabled\': dropdownDisabled}" class="wrap-dd-select" tabindex="0" >' ,
12
12
'<span class="selected">{{dropdownModel[labelField]}}</span>' ,
13
13
'<ul class="dropdown">' ,
14
14
'<li ng-repeat="item in dropdownSelect"' ,
94
94
}
95
95
} ) ;
96
96
97
+ $element . bind ( 'focus' , function ( event ) {
98
+ event . stopPropagation ( ) ;
99
+ if ( ! $scope . dropdownDisabled ) {
100
+ DropdownService . toggleActive ( $element ) ;
101
+ }
102
+ } ) ;
103
+
97
104
$scope . $on ( '$destroy' , function ( ) {
98
105
DropdownService . unregister ( $element ) ;
99
106
} ) ;
218
225
} ) ;
219
226
} ) ;
220
227
228
+ body . keydown ( function ( e ) {
229
+ var code = e . keyCode || e . which ;
230
+ if ( code == '9' ) {
231
+ angular . forEach ( _dropdowns , function ( el ) {
232
+ el . removeClass ( 'active' ) ;
233
+ } ) ;
234
+ }
235
+ } ) ;
236
+
221
237
service . register = function ( ddEl ) {
222
238
_dropdowns . push ( ddEl ) ;
223
239
} ;
You can’t perform that action at this time.
0 commit comments