@@ -509,14 +509,11 @@ export class Select<T extends SelectOption> extends FormElement {
509
509
510
510
private lastQuery : number ;
511
511
512
- // private cancelToken: CancelTokenSource;
513
512
private complete : boolean ;
514
513
private page : number ;
515
514
private next : string = null ;
516
515
private query : string ;
517
516
518
- private removingSelection : boolean ;
519
-
520
517
private lruCache = lru ( 20 , 60000 ) ;
521
518
522
519
constructor ( ) {
@@ -632,10 +629,6 @@ export class Select<T extends SelectOption> extends FormElement {
632
629
'slotchange' ,
633
630
this . handleSlotChange . bind ( this )
634
631
) ;
635
-
636
- // if (!this.placeholder || this.value) {
637
- // this.checkSelectedOption();
638
- // }
639
632
}
640
633
641
634
public updated ( changes : Map < string , any > ) {
@@ -646,21 +639,15 @@ export class Select<T extends SelectOption> extends FormElement {
646
639
}
647
640
648
641
if ( changes . has ( 'value' ) ) {
649
- // console.log('value from', changes.get('value'), 'to', this.value);
650
642
if ( this . value && ! this . values . length ) {
651
- // console.log('setting selected value for value change', this.value);
652
643
this . setSelectedValue ( this . value ) ;
653
644
}
654
645
}
655
646
656
647
if ( changes . has ( 'values' ) ) {
657
- // console.log('values from', changes.get('values'), 'to', this.values);
658
648
this . updateInputs ( ) ;
659
649
if ( this . hasChanges ( changes . get ( 'values' ) ) ) {
660
- // console.log('firing change', changes.get('values'), this.values);
661
650
this . fireEvent ( 'change' ) ;
662
- } else {
663
- // console.log('no changes', changes.get('values'), this.values);
664
651
}
665
652
}
666
653
@@ -743,7 +730,6 @@ export class Select<T extends SelectOption> extends FormElement {
743
730
}
744
731
745
732
public setSelectedValue ( value : string ) {
746
- // console.log('setting value', value);
747
733
if ( this . staticOptions . length > 0 ) {
748
734
const existing = this . staticOptions . find ( ( option ) => {
749
735
return this . getValue ( option ) === value ;
@@ -878,7 +864,6 @@ export class Select<T extends SelectOption> extends FormElement {
878
864
}
879
865
880
866
public open ( ) : void {
881
- // this.requestUpdate('input');
882
867
(
883
868
this . shadowRoot . querySelector ( '.select-container' ) as HTMLDivElement
884
869
) . click ( ) ;
@@ -1004,11 +989,6 @@ export class Select<T extends SelectOption> extends FormElement {
1004
989
if ( ! this . fetching ) {
1005
990
this . fetching = true ;
1006
991
1007
- // make sure we cancel any previous request
1008
- // if (this.cancelToken) {
1009
- // this.cancelToken.cancel();
1010
- // }
1011
-
1012
992
const options : any = [ ...this . staticOptions ] ;
1013
993
const q = ( query || '' ) . trim ( ) . toLowerCase ( ) ;
1014
994
@@ -1134,9 +1114,6 @@ export class Select<T extends SelectOption> extends FormElement {
1134
1114
private handleFocus ( ) : void {
1135
1115
if ( ! this . focused && this . visibleOptions . length === 0 ) {
1136
1116
this . focused = true ;
1137
- //if (this.searchOnFocus && !this.removingSelection) {
1138
- //this.requestUpdate('input');
1139
- //}
1140
1117
}
1141
1118
}
1142
1119
0 commit comments