Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notFoundText shouldn't be displayed when loading async data #243

Closed
shyamal890 opened this issue Feb 8, 2018 · 2 comments · Fixed by #252
Closed

notFoundText shouldn't be displayed when loading async data #243

shyamal890 opened this issue Feb 8, 2018 · 2 comments · Fixed by #252

Comments

@shyamal890
Copy link

When [loading] flag is set notFoundText shouldn't be triggered as the [items] array is still waiting to be populated by an async operation.

Example Plunker: https://plnkr.co/edit/XU3qdu?p=preview

Checkout the first example.

@anjmao
Copy link
Member

anjmao commented Feb 9, 2018

@shyamal890 Thanks for reporting, good catch!

@anjmao anjmao added the bug label Feb 9, 2018
@anjmao
Copy link
Member

anjmao commented Feb 9, 2018

This line here is missing some logic https://github.com/ng-select/ng-select/blob/master/src/ng-select/ng-select.component.ts#L369, need to add check if !isLoading

const empty = this.itemsList.filteredItems.length === 0;
return (empty && !this._isTypeahead && !this.isLoading) ||
       (empty && this._isTypeahead && this.filterValue && !this.isLoading);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants