mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Clear last search term when clear button clicked
This commit is contained in:
parent
8ddb3e80b7
commit
b6756595d9
@ -11,7 +11,8 @@
|
|||||||
bindValue="id"
|
bindValue="id"
|
||||||
(change)="onChange(value)"
|
(change)="onChange(value)"
|
||||||
(search)="onSearch($event)"
|
(search)="onSearch($event)"
|
||||||
(focus)="onFocus()"
|
(focus)="clearLastSearchTerm()"
|
||||||
|
(clear)="clearLastSearchTerm()"
|
||||||
(blur)="onBlur()">
|
(blur)="onBlur()">
|
||||||
</ng-select>
|
</ng-select>
|
||||||
|
|
||||||
|
@ -52,10 +52,10 @@ export class SelectComponent extends AbstractInputComponent<number> {
|
|||||||
|
|
||||||
clickNew() {
|
clickNew() {
|
||||||
this.createNew.next(this._lastSearchTerm)
|
this.createNew.next(this._lastSearchTerm)
|
||||||
this._lastSearchTerm = null
|
this.clearLastSearchTerm()
|
||||||
}
|
}
|
||||||
|
|
||||||
onFocus() {
|
clearLastSearchTerm() {
|
||||||
this._lastSearchTerm = null
|
this._lastSearchTerm = null
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ export class SelectComponent extends AbstractInputComponent<number> {
|
|||||||
|
|
||||||
onBlur() {
|
onBlur() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this._lastSearchTerm = null
|
this.clearLastSearchTerm()
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
[hideSelected]="true"
|
[hideSelected]="true"
|
||||||
(change)="onChange(value)"
|
(change)="onChange(value)"
|
||||||
(search)="onSearch($event)"
|
(search)="onSearch($event)"
|
||||||
(focus)="onFocus()"
|
(focus)="clearLastSearchTerm()"
|
||||||
|
(clear)="clearLastSearchTerm()"
|
||||||
(blur)="onBlur()">
|
(blur)="onBlur()">
|
||||||
|
|
||||||
<ng-template ng-label-tmp let-item="item">
|
<ng-template ng-label-tmp let-item="item">
|
||||||
|
@ -105,7 +105,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
|||||||
this.onChange(this.value)
|
this.onChange(this.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
onFocus() {
|
clearLastSearchTerm() {
|
||||||
this._lastSearchTerm = null
|
this._lastSearchTerm = null
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ export class TagsComponent implements OnInit, ControlValueAccessor {
|
|||||||
|
|
||||||
onBlur() {
|
onBlur() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this._lastSearchTerm = null
|
this.clearLastSearchTerm()
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user