File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -444,6 +444,7 @@ uis.controller('uiSelectCtrl',
444
444
} ;
445
445
446
446
var sizeWatch = null ;
447
+ var updaterScheduled = false ;
447
448
ctrl . sizeSearchInput = function ( ) {
448
449
449
450
var input = ctrl . searchInput [ 0 ] ,
@@ -465,10 +466,16 @@ uis.controller('uiSelectCtrl',
465
466
ctrl . searchInput . css ( 'width' , '10px' ) ;
466
467
$timeout ( function ( ) { //Give tags time to render correctly
467
468
if ( sizeWatch === null && ! updateIfVisible ( calculateContainerWidth ( ) ) ) {
468
- sizeWatch = $scope . $watch ( calculateContainerWidth , function ( containerWidth ) {
469
- if ( updateIfVisible ( containerWidth ) ) {
470
- sizeWatch ( ) ;
471
- sizeWatch = null ;
469
+ sizeWatch = $scope . $watch ( angular . noop , function ( ) {
470
+ if ( ! updaterScheduled ) {
471
+ updaterScheduled = true ;
472
+ $scope . $$postDigest ( function ( ) {
473
+ updaterScheduled = false ;
474
+ if ( updateIfVisible ( calculateContainerWidth ( ) ) ) {
475
+ sizeWatch ( ) ;
476
+ sizeWatch = null ;
477
+ }
478
+ } ) ;
472
479
}
473
480
} ) ;
474
481
}
You can’t perform that action at this time.
0 commit comments