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

Commit 457be42

Browse files
committed
Merge branch 'master' of https://github.com/loose11/ui-select into loose11-master
# Conflicts: # dist/select.css # dist/select.js # dist/select.min.css # dist/select.min.js
2 parents b1c4fdc + 583f2ba commit 457be42

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/uiSelectMultipleDirective.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,13 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
105105
locals[$select.parserResult.itemName] = list[p];
106106
result = $select.parserResult.modelMapper(scope, locals);
107107
if($select.parserResult.trackByExp){
108-
var matches = /\.(.+)/.exec($select.parserResult.trackByExp);
109-
if(matches.length>0 && result[matches[1]] == value[matches[1]]){
110-
resultMultiple.unshift(list[p]);
111-
return true;
108+
var propsItemNameMatches = /(\w*)\./.exec($select.parserResult.trackByExp);
109+
var matches = /\.([^\s]+)/.exec($select.parserResult.trackByExp);
110+
if(propsItemNameMatches.length > 0 && propsItemNameMatches[1] == $select.parserResult.itemName){
111+
if(matches.length>0 && result[matches[1]] == value[matches[1]]){
112+
resultMultiple.unshift(list[p]);
113+
return true;
114+
}
112115
}
113116
}
114117
if (angular.equals(result,value)){

0 commit comments

Comments
 (0)