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

Not Found is not displayed when the data is updated in inputChanged. #199

Open
sharangupta96 opened this issue Jul 14, 2022 · 0 comments
Open

Comments

@sharangupta96
Copy link

sharangupta96 commented Jul 14, 2022

Bug description

html:
<ng-autocomplete
[data]="countries"
[searchKeyword]="keyword"
placeholder="Enter the Country Name"
(selected)='selectEvent($event)'
(inputChanged)='onChangeSearch($event)'
[itemTemplate]="itemTemplate"
[notFoundTemplate]="notFoundTemplate">

<ng-template #itemTemplate let-item>
<a [innerHTML]="item.name">

<ng-template #notFoundTemplate let-notFound>
<div [innerHTML]="notFound">

in ts file:
public countries = [];

onChangeSearch(search: string) {
this.countries = [
{
id: 1,
name: 'Albania 1',
},
{
id: 2,
name: 'Belgium 2',
},
{
id: 3,
name: 'Denmark',
}
];
}

Expected result

If I search for New York, the results should be shown as "Not Found"

Actual result

Nothing is show.. panel is not opened if no match found.

Steps to reproduce

  1. update the data in onChangeSearch and search for a non available data.

Your Environment

  • Version used: 2.0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant