Skip to content

Commit d5fe771

Browse files
AymanJitanMichael Blakeney
authored andcommitted
fix view item matching issues (#4)
commit 2c6300c Author: AymanJitan <ayman.jitan@gmail.com> Date: Tue Mar 8 15:07:30 2016 -0500 build commit 80a5825 Author: AymanJitan <ayman.jitan@gmail.com> Date: Tue Mar 8 14:50:39 2016 -0500 fix view item matching issues
1 parent 3cbb7df commit d5fe771

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dist/sc-select.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ return /******/ (function(modules) { // webpackBootstrap
302302
}
303303
return found;
304304
} else {
305+
if (typeof itemValue === 'object') {
306+
return ngModelCtrl.$viewValue === itemValue.id || ngModelCtrl.$viewValue === itemValue.label || ngModelCtrl.$viewValue.id === itemValue.id;
307+
}
305308
return ngModelCtrl.$viewValue === itemValue;
306309
}
307310
});

src/directives/scSelect.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ export default function scSelect() {
149149
}
150150
return found;
151151
} else {
152+
if (typeof itemValue === 'object') {
153+
return ngModelCtrl.$viewValue === itemValue.id || ngModelCtrl.$viewValue === itemValue.label || ngModelCtrl.$viewValue.id === itemValue.id;
154+
}
152155
return ngModelCtrl.$viewValue === itemValue;
153156
}
154157
});

0 commit comments

Comments
 (0)