diff --git a/src-ui/src/app/components/common/input/select/select.component.html b/src-ui/src/app/components/common/input/select/select.component.html index a2834a1c..f9f05b6f 100644 --- a/src-ui/src/app/components/common/input/select/select.component.html +++ b/src-ui/src/app/components/common/input/select/select.component.html @@ -11,7 +11,8 @@ bindValue="id" (change)="onChange(value)" (search)="onSearch($event)" - (focus)="onFocus()" + (focus)="clearLastSearchTerm()" + (clear)="clearLastSearchTerm()" (blur)="onBlur()"> diff --git a/src-ui/src/app/components/common/input/select/select.component.ts b/src-ui/src/app/components/common/input/select/select.component.ts index 438925d3..408b3a73 100644 --- a/src-ui/src/app/components/common/input/select/select.component.ts +++ b/src-ui/src/app/components/common/input/select/select.component.ts @@ -52,10 +52,10 @@ export class SelectComponent extends AbstractInputComponent { clickNew() { this.createNew.next(this._lastSearchTerm) - this._lastSearchTerm = null + this.clearLastSearchTerm() } - onFocus() { + clearLastSearchTerm() { this._lastSearchTerm = null } @@ -65,7 +65,7 @@ export class SelectComponent extends AbstractInputComponent { onBlur() { setTimeout(() => { - this._lastSearchTerm = null + this.clearLastSearchTerm() }, 3000); } diff --git a/src-ui/src/app/components/common/input/tags/tags.component.html b/src-ui/src/app/components/common/input/tags/tags.component.html index df6621fb..6eda2a44 100644 --- a/src-ui/src/app/components/common/input/tags/tags.component.html +++ b/src-ui/src/app/components/common/input/tags/tags.component.html @@ -9,7 +9,8 @@ [hideSelected]="true" (change)="onChange(value)" (search)="onSearch($event)" - (focus)="onFocus()" + (focus)="clearLastSearchTerm()" + (clear)="clearLastSearchTerm()" (blur)="onBlur()"> diff --git a/src-ui/src/app/components/common/input/tags/tags.component.ts b/src-ui/src/app/components/common/input/tags/tags.component.ts index a1a803b6..5c413a7c 100644 --- a/src-ui/src/app/components/common/input/tags/tags.component.ts +++ b/src-ui/src/app/components/common/input/tags/tags.component.ts @@ -105,7 +105,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor { this.onChange(this.value) } - onFocus() { + clearLastSearchTerm() { this._lastSearchTerm = null } @@ -115,7 +115,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor { onBlur() { setTimeout(() => { - this._lastSearchTerm = null + this.clearLastSearchTerm() }, 3000); }