Skip to content

Commit

Permalink
fix(dropdownlist): fix dropdownlist loading all time when even though…
Browse files Browse the repository at this point in the history
… the data is empty.
  • Loading branch information
WilliamAguera committed Nov 6, 2019
1 parent 0dfbbe3 commit f84f25a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions projects/truly-ui/src/components/dropdownlist/dropdownlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
Optional,
ContentChild,
ViewChild,
ElementRef, OnChanges, EventEmitter, AfterContentInit, OnInit, ChangeDetectorRef
ElementRef, OnChanges, EventEmitter, AfterContentInit, OnInit, ChangeDetectorRef, SimpleChanges
} from '@angular/core';

import * as objectPath from 'object-path';
Expand Down Expand Up @@ -365,7 +365,11 @@ export class TlDropDownList extends ValueAccessorBase<any> implements OnChanges,
return String( objectPath.get( item, this.keyText ) ).substring( 0, 1 ).toLowerCase();
}

ngOnChanges( changes ) {
ngOnChanges( { data }: SimpleChanges ) {
if ( data ) {
if (!data.firstChange && data.currentValue.length === 0) {
this.isLoading = false;
}
}
}

}

0 comments on commit f84f25a

Please sign in to comment.