@@ -779,7 +779,7 @@ export class UiSuggestComponent extends UiSuggestMatFormFieldDirective
779779 end : Number . POSITIVE_INFINITY ,
780780 } ;
781781
782- private _inputChange$ : Observable < string > ;
782+ private _inputChange$ ! : Observable < string > ;
783783 private _drillDown = false ;
784784 private _lazyLoadLastArgument : any [ ] = [ '' , 0 , 0 ] ;
785785
@@ -810,34 +810,6 @@ export class UiSuggestComponent extends UiSuggestMatFormFieldDirective
810810 cd ,
811811 ngControl ,
812812 ) ;
813-
814- this . _inputChange$ = combineLatest ( [
815- this . inputControl . valueChanges . pipe (
816- startWith ( '' ) ,
817- map ( ( v = '' ) => v . trim ( ) ) ,
818- distinctUntilChanged ( ) ,
819- filter ( v => v . length >= this . minChars ) ,
820- tap ( v => v && this . multiple && this . open ( ) ) ,
821- tap ( this . _setLoadingState ) ,
822- debounceTime ( this . debounceTime ) ,
823- filter ( _ => ! ! this . searchSourceFactory ) ,
824- ) ,
825- this . _disabled$ . pipe ( filter ( v => ! v ) ) ,
826- this . _fetchStrategy$
827- . pipe (
828- switchMap ( strategy => {
829- switch ( strategy ) {
830- case 'onOpen' :
831- return this . _isOpen$ . pipe ( filter ( o => ! ! o ) ) ;
832- case 'eager' :
833- return of ( strategy ) ;
834- }
835- } ) ,
836- ) ,
837- ] ) . pipe (
838- map ( ( [ value ] ) => value ) ,
839- ) ;
840-
841813 this . _initResizeObserver ( ) ;
842814
843815 this . _height$ . subscribe ( heightValue => {
@@ -877,6 +849,35 @@ export class UiSuggestComponent extends UiSuggestMatFormFieldDirective
877849 this . _initOverlayPositions ( ) ;
878850 this . dropdownPosition = [ this . direction && this . direction === 'up' ? this . upPosition : this . downPosition ] ;
879851
852+ this . _inputChange$ = combineLatest ( [
853+ this . inputControl . valueChanges . pipe (
854+ startWith ( '' ) ,
855+ map ( ( v = '' ) => v . trim ( ) ) ,
856+ distinctUntilChanged ( ) ,
857+ filter ( v => v . length >= this . minChars ) ,
858+ tap ( v => v && this . multiple && this . open ( ) ) ,
859+ tap ( this . _setLoadingState ) ,
860+ debounceTime ( this . debounceTime ) ,
861+ filter ( _ => ! ! this . searchSourceFactory ) ,
862+ ) ,
863+ this . _disabled$ . pipe (
864+ filter ( v => ! v ) ,
865+ ) ,
866+ this . _fetchStrategy$
867+ . pipe (
868+ switchMap ( strategy => {
869+ switch ( strategy ) {
870+ case 'onOpen' :
871+ return this . _isOpen$ . pipe ( filter ( o => ! ! o ) ) ;
872+ case 'eager' :
873+ return of ( strategy ) ;
874+ }
875+ } ) ,
876+ ) ,
877+ ] ) . pipe (
878+ map ( ( [ value ] ) => value as any ) ,
879+ ) ;
880+
880881 merge (
881882 this . _reset$ . pipe (
882883 map ( _ => '' ) ,
0 commit comments