Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Clear last search term when clear button clicked

Michael Shamoonb6756595d98a
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 a2834a1c9..f9f05b6fa 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()">
</ng-select>
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 438925d32..408b3a73a 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<number> {
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<number> {
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 df6621fb0..6eda2a44d 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()">
<ng-template ng-label-tmp let-item="item">
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 a1a803b61..5c413a7c6 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);
}