Closed DavidSegura closed 1 year ago
This parameter is required: customSearchEnabled
<select2 [data]="data"
customSearchEnabled
(search)="_search($event)"></select2>
I change the generator to indicate this.
Same problem in Angular 16:
<div class="mt-5">
<form>
<div class="form-group row">
<div class="col-md-4">
<div style="width: 100%">
<div class="input-group">
<select2
customSearchEnabled
[data]="data"
(search)="searchTrack($event)"
displaySearchStatus="always"
placeholder="Select track"
></select2>
<div class="input-group-prepend">
<button class="btn btn-primary" type="button"><i class="fa fa-plus"></i></button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
export class SessionsAddTracksComponent {
public data = [
{ value: 1, label: 'hola' },
];
/**
* On search track
*/
public searchTrack(event: Select2SearchEvent): void {
console.log(event);
}
}
The searchTrack method is never fired. What could be happening?
Please open a new issue. @mcfdez
For me it works : https://stackblitz.com/edit/stackblitz-starters-csm2lz?file=src%2Fmain.ts
Good afternoon,
I have tested the library in a new project with angular 14. And the search event does not fire when I perform a search.
Thanks for your time