mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Add timeout for clearing last search term on select blur
This commit is contained in:
		| @@ -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"> | ||||
|   | ||||
| @@ -63,4 +63,10 @@ export class SelectComponent extends AbstractInputComponent<number> { | ||||
|     this._lastSearchTerm = $event.term | ||||
|   } | ||||
|  | ||||
|   onBlur() { | ||||
|     setTimeout(() => { | ||||
|       this._lastSearchTerm = null | ||||
|     }, 3000); | ||||
|   } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -9,7 +9,8 @@ | ||||
|       [hideSelected]="true" | ||||
|       (change)="onChange(value)" | ||||
|       (search)="onSearch($event)" | ||||
|       (focus)="onFocus()"> | ||||
|       (focus)="onFocus()" | ||||
|       (blur)="onBlur()"> | ||||
|  | ||||
|       <ng-template ng-label-tmp let-item="item"> | ||||
|         <span class="tag-wrap tag-wrap-delete" (click)="removeTag(item.id)"> | ||||
|   | ||||
| @@ -113,4 +113,10 @@ export class TagsComponent implements OnInit, ControlValueAccessor { | ||||
|     this._lastSearchTerm = $event.term | ||||
|   } | ||||
|  | ||||
|   onBlur() { | ||||
|     setTimeout(() => { | ||||
|       this._lastSearchTerm = null | ||||
|     }, 3000); | ||||
|   } | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon