@@ -67,7 +67,7 @@ uis.directive('uiSelectChoices',
67
67
scope . $watch ( '$select.search' , function ( newValue ) {
68
68
if ( newValue && ! $select . open && $select . multiple ) $select . activate ( false , true ) ;
69
69
$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 ) ) ) {
71
71
$select . refresh ( attrs . refresh ) ;
72
72
} else {
73
73
$select . items = [ ] ;
@@ -79,19 +79,14 @@ uis.directive('uiSelectChoices',
79
79
var refreshDelay = scope . $eval ( attrs . refreshDelay ) ;
80
80
$select . refreshDelay = refreshDelay !== undefined ? refreshDelay : uiSelectConfig . refreshDelay ;
81
81
} ) ;
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
- }
91
82
92
83
scope . $watch ( '$select.open' , function ( open ) {
93
84
if ( open ) {
94
85
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
+ }
95
90
} else {
96
91
tElement . removeAttr ( 'role' ) ;
97
92
}
0 commit comments