This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ angular.module('ui.select', [])
152
152
153
153
function ensureHighlightVisible ( ) {
154
154
var rows = element . querySelectorAll ( '.ui-select-choices-row' ) ;
155
- if ( ! rows . length ) return ; // In case its empty
155
+ if ( ! rows . length ) return ;
156
156
var highlighted = rows [ scope . $select . activeIdx ] ,
157
157
posY = highlighted . offsetTop + highlighted . clientHeight - container . scrollTop ,
158
158
maxHeight = 200 ; // TODO Need to get this value from container.max-height
@@ -191,13 +191,7 @@ angular.module('ui.select', [])
191
191
}
192
192
193
193
} else if ( evt . which === 13 || evt . which === 9 ) { // enter(13) and tab(9)
194
- if ( window . jQuery ) {
195
- // Firefox 3.6 does not support element.click()
196
- // See HTMLElement.click https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.click
197
- $ ( rows [ scope . $select . activeIdx ] ) . click ( ) ;
198
- } else {
199
- rows [ scope . $select . activeIdx ] . click ( ) ;
200
- }
194
+ angular . element ( rows [ scope . $select . activeIdx ] ) . triggerHandler ( 'click' ) ;
201
195
202
196
} else if ( evt . which === 27 ) { // esc(27)
203
197
evt . stopPropagation ( ) ;
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ angular.module('ui.select', [])
152
152
153
153
function ensureHighlightVisible ( ) {
154
154
var rows = element . querySelectorAll ( '.ui-select-choices-row' ) ;
155
- if ( ! rows . length ) return ; // In case its empty
155
+ if ( ! rows . length ) return ;
156
156
var highlighted = rows [ scope . $select . activeIdx ] ,
157
157
posY = highlighted . offsetTop + highlighted . clientHeight - container . scrollTop ,
158
158
maxHeight = 200 ; // TODO Need to get this value from container.max-height
@@ -191,13 +191,7 @@ angular.module('ui.select', [])
191
191
}
192
192
193
193
} else if ( evt . which === 13 || evt . which === 9 ) { // enter(13) and tab(9)
194
- if ( window . jQuery ) {
195
- // Firefox 3.6 does not support element.click()
196
- // See HTMLElement.click https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.click
197
- $ ( rows [ scope . $select . activeIdx ] ) . click ( ) ;
198
- } else {
199
- rows [ scope . $select . activeIdx ] . click ( ) ;
200
- }
194
+ angular . element ( rows [ scope . $select . activeIdx ] ) . triggerHandler ( 'click' ) ;
201
195
202
196
} else if ( evt . which === 27 ) { // esc(27)
203
197
evt . stopPropagation ( ) ;
You can’t perform that action at this time.
0 commit comments