Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit eeea710

Browse files
author
Brian Feister
committed
Fix over-selection in dropdown
1 parent b61bf9c commit eeea710

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

dist/select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* ui-select
33
* http://github.com/angular-ui/ui-select
4-
* Version: 0.8.3 - 2014-10-20T13:48:28.234Z
4+
* Version: 0.8.3 - 2014-10-20T16:06:30.609Z
55
* License: MIT
66
*/
77

dist/select.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* ui-select
33
* http://github.com/angular-ui/ui-select
4-
* Version: 0.8.3 - 2014-10-20T13:48:28.231Z
4+
* Version: 0.8.3 - 2014-10-20T16:06:30.607Z
55
* License: MIT
66
*/
77

@@ -316,10 +316,14 @@
316316
};
317317

318318
ctrl.isActive = function(itemScope) {
319-
if ( typeof itemScope[ctrl.itemProperty] === 'undefined') {
320-
return false;
319+
var itemIndex = ctrl.items.indexOf(itemScope[ctrl.itemProperty]);
320+
if ( ctrl.open && ( ctrl.items.indexOf(itemScope[ctrl.itemProperty]) === ctrl.activeIndex ) ) {
321+
var item = ctrl.items[itemIndex];
322+
if ( typeof item === 'undefined' ) {
323+
return ctrl.open && false;
324+
}
321325
}
322-
return ctrl.open && ctrl.items.indexOf(itemScope[ctrl.itemProperty]) === ctrl.activeIndex;
326+
return ctrl.open && itemIndex === ctrl.activeIndex;
323327
};
324328

325329
ctrl.isDisabled = function(itemScope) {

dist/select.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)