oferh / ng2-completer

Angular 2 autocomplete component
http://oferh.github.io/ng2-completer/
MIT License
347 stars 172 forks source link

Cancel button not working having initial value #235

Open saifulazad opened 7 years ago

saifulazad commented 7 years ago

I am using ng2-completer. This is nice and useful. But I am facing a problem. when I have an initial value there is a close button. when I click close button (selected) event is not triggered :( . Please observe the image

Image

                      `<ng2-completer [datasource]="projectData"
                                               [minSearchLength]="2"
                                                 [(ngModel)]="projectName"

                                       [inputId]="'exampleTextarea'"
                                       class="custom-completer"
                                        [ngModelOptions]="{standalone: true}"
                                       [inputClass]="'custom-autc-field custom-block-width'"
                                       (selected)="getData($event,  'project')"
                                       [textSearching]="'Please wait...'">
                        </ng2-completer>`

Here projectName is a string fetching from the server and treated as the initial value. But when I selelect a value from dropdown and click close button then for both select and deselect, (selected) event is triggered.

oferh commented 7 years ago

sorry about the late response, is it still relevant?