Add timeout for clearing last search term on select blur

This commit is contained in:
Michael Shamoon
2021-03-24 12:21:51 -07:00
parent 567161b2c0
commit 904ff04f1d
4 changed files with 16 additions and 2 deletions

View File

@@ -11,7 +11,8 @@
bindValue="id"
(change)="onChange(value)"
(search)="onSearch($event)"
(focus)="onFocus()">
(focus)="onFocus()"
(blur)="onBlur()">
</ng-select>
<div *ngIf="showPlusButton()" class="input-group-append">

View File

@@ -63,4 +63,10 @@ export class SelectComponent extends AbstractInputComponent<number> {
this._lastSearchTerm = $event.term
}
onBlur() {
setTimeout(() => {
this._lastSearchTerm = null
}, 3000);
}
}