mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	focus text filter input automatically
This commit is contained in:
		@@ -8,7 +8,7 @@
 | 
				
			|||||||
              <button *ngFor="let t of textFilterTargets" ngbDropdownItem [class.active]="textFilterTarget == t.id" (click)="changeTextFilterTarget(t.id)">{{t.name}}</button>
 | 
					              <button *ngFor="let t of textFilterTargets" ngbDropdownItem [class.active]="textFilterTarget == t.id" (click)="changeTextFilterTarget(t.id)">{{t.name}}</button>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          <input class="form-control form-control-sm" type="text" [(ngModel)]="textFilter" [readonly]="textFilterTarget == 'fulltext-morelike'">
 | 
					          <input #textFilterInput class="form-control form-control-sm" type="text" [(ngModel)]="textFilter" [readonly]="textFilterTarget == 'fulltext-morelike'">
 | 
				
			||||||
         </div>
 | 
					         </div>
 | 
				
			||||||
     </div>
 | 
					     </div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
import { Component, EventEmitter, Input, Output, OnInit, OnDestroy } from '@angular/core';
 | 
					import { Component, EventEmitter, Input, Output, OnInit, OnDestroy, ViewChild, ElementRef } from '@angular/core';
 | 
				
			||||||
import { PaperlessTag } from 'src/app/data/paperless-tag';
 | 
					import { PaperlessTag } from 'src/app/data/paperless-tag';
 | 
				
			||||||
import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent';
 | 
					import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent';
 | 
				
			||||||
import { PaperlessDocumentType } from 'src/app/data/paperless-document-type';
 | 
					import { PaperlessDocumentType } from 'src/app/data/paperless-document-type';
 | 
				
			||||||
@@ -72,6 +72,9 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
    private documentService: DocumentService
 | 
					    private documentService: DocumentService
 | 
				
			||||||
  ) { }
 | 
					  ) { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @ViewChild("textFilterInput")
 | 
				
			||||||
 | 
					  textFilterInput: ElementRef
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  tags: PaperlessTag[] = []
 | 
					  tags: PaperlessTag[] = []
 | 
				
			||||||
  correspondents: PaperlessCorrespondent[] = []
 | 
					  correspondents: PaperlessCorrespondent[] = []
 | 
				
			||||||
  documentTypes: PaperlessDocumentType[] = []
 | 
					  documentTypes: PaperlessDocumentType[] = []
 | 
				
			||||||
@@ -330,6 +333,7 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
      this._textFilter = ""
 | 
					      this._textFilter = ""
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    this.textFilterTarget = target
 | 
					    this.textFilterTarget = target
 | 
				
			||||||
 | 
					    this.textFilterInput.nativeElement.focus()
 | 
				
			||||||
    this.updateRules()
 | 
					    this.updateRules()
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user