This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree 1 file changed +7
-3
lines changed 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 169
169
ctrl . lockChoiceExpression = undefined ; // Initialized inside uiSelect directive link function
170
170
ctrl . closeOnSelect = true ; // Initialized inside uiSelect directive link function
171
171
ctrl . clickTriggeredSelect = false ;
172
+ ctrl . $filter = $filter ;
172
173
173
174
ctrl . isEmpty = function ( ) {
174
175
return angular . isUndefined ( ctrl . selected ) || ctrl . selected === null || ctrl . selected === '' ;
316
317
} ;
317
318
318
319
ctrl . isActive = function ( itemScope ) {
319
- var isActive = ctrl . open && ctrl . items . indexOf ( itemScope [ ctrl . itemProperty ] ) === ctrl . activeIndex ;
320
+ if ( ! ctrl . open ) {
321
+ return false ;
322
+ }
323
+ var itemIndex = ctrl . items . indexOf ( itemScope [ ctrl . itemProperty ] ) ;
324
+ var isActive = itemIndex === ctrl . activeIndex ;
320
325
321
- if ( ! isActive ) {
326
+ if ( ! isActive || itemIndex < 0 ) {
322
327
return false ;
323
328
}
324
329
if ( isActive && ! angular . isUndefined ( ctrl . onHighlightCallback ) ) {
325
330
itemScope . $eval ( ctrl . onHighlightCallback ) ;
326
331
}
327
332
328
- var itemIndex = ctrl . items . indexOf ( itemScope [ ctrl . itemProperty ] ) ;
329
333
if ( ctrl . taggingLabel === false && ctrl . activeIndex === - 1 ) {
330
334
return false ;
331
335
}
You can’t perform that action at this time.
0 commit comments