@@ -224,6 +224,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
224
224
optionsExp = attr . ngOptions ,
225
225
nullOption = false , // if false, user will not be able to select it (used by ngOptions)
226
226
emptyOption ,
227
+ renderScheduled = false ,
227
228
// we can't just jqLite('<option>') since jqLite is not smart enough
228
229
// to create it in <select> and IE barfs otherwise.
229
230
optionTemplate = jqLite ( document . createElement ( 'option' ) ) ,
@@ -414,14 +415,16 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
414
415
ctrl . $render = render ;
415
416
416
417
scope . $watchCollection ( valuesFn , function ( ) {
417
- if ( scope . $$postDigestQueue . indexOf ( render ) === - 1 ) {
418
+ if ( ! renderScheduled ) {
418
419
scope . $$postDigest ( render ) ;
420
+ renderScheduled = true ;
419
421
}
420
422
} ) ;
421
423
if ( multiple ) {
422
424
scope . $watchCollection ( function ( ) { return ctrl . $modelValue ; } , function ( ) {
423
- if ( scope . $$postDigestQueue . indexOf ( render ) === - 1 ) {
425
+ if ( ! renderScheduled ) {
424
426
scope . $$postDigest ( render ) ;
427
+ renderScheduled = true ;
425
428
}
426
429
} ) ;
427
430
}
@@ -612,6 +615,8 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
612
615
while ( optionGroupsCache . length > groupIndex ) {
613
616
optionGroupsCache . pop ( ) [ 0 ] . element . remove ( ) ;
614
617
}
618
+
619
+ renderScheduled = false ;
615
620
}
616
621
}
617
622
}
0 commit comments