@@ -67,7 +67,7 @@ uis.directive('uiSelectChoices',
6767 scope . $watch ( '$select.search' , function ( newValue ) {
6868 if ( newValue && ! $select . open && $select . multiple ) $select . activate ( false , true ) ;
6969 $select . activeIndex = $select . tagging . isActivated ? - 1 : 0 ;
70- if ( ( ! attrs . minimumInputLength || $select . search . length >= attrs . minimumInputLength ) && ( ! $select . refreshOnActive || ( $select . refreshOnActive && $select . refreshIsActive ) ) ) {
70+ if ( ( ! attrs . minimumInputLength || $select . search . length >= attrs . minimumInputLength ) && ( ! $select . refreshOnActive || ( $select . refreshOnActive && $select . open ) ) ) {
7171 $select . refresh ( attrs . refresh ) ;
7272 } else {
7373 $select . items = [ ] ;
@@ -79,19 +79,14 @@ uis.directive('uiSelectChoices',
7979 var refreshDelay = scope . $eval ( attrs . refreshDelay ) ;
8080 $select . refreshDelay = refreshDelay !== undefined ? refreshDelay : uiSelectConfig . refreshDelay ;
8181 } ) ;
82-
83- if ( ! angular . isUndefined ( $select . refreshOnActive ) ) {
84- //only add a watch when refreshonactive is set.
85- scope . $watch ( '$select.refreshIsActive' , function ( newValue , oldValue ) {
86- if ( angular . isUndefined ( oldValue ) && newValue ) {
87- $select . refresh ( attrs . refresh ) ;
88- }
89- } ) ;
90- }
9182
9283 scope . $watch ( '$select.open' , function ( open ) {
9384 if ( open ) {
9485 tElement . attr ( 'role' , 'listbox' ) ;
86+ if ( ! angular . isUndefined ( $select . refreshOnActive ) ) {
87+ //only add a watch when refreshonactive is set.
88+ $select . refresh ( attrs . refresh ) ;
89+ }
9590 } else {
9691 tElement . removeAttr ( 'role' ) ;
9792 }
0 commit comments