From 1fbd3935ea3a660375f74298cb57050809778236 Mon Sep 17 00:00:00 2001
From: jonaswinkler <17569239+jonaswinkler@users.noreply.github.com>
Date: Mon, 5 Apr 2021 21:42:41 +0200
Subject: [PATCH] focus text filter input automatically
---
.../filter-editor/filter-editor.component.html | 2 +-
.../document-list/filter-editor/filter-editor.component.ts | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html
index 1fbe53d67..c61f36c3f 100644
--- a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html
+++ b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html
@@ -8,7 +8,7 @@
-
+
diff --git a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.ts b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.ts
index a4463a64b..777c92e07 100644
--- a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.ts
+++ b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.ts
@@ -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 { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent';
import { PaperlessDocumentType } from 'src/app/data/paperless-document-type';
@@ -72,6 +72,9 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
private documentService: DocumentService
) { }
+ @ViewChild("textFilterInput")
+ textFilterInput: ElementRef
+
tags: PaperlessTag[] = []
correspondents: PaperlessCorrespondent[] = []
documentTypes: PaperlessDocumentType[] = []
@@ -330,6 +333,7 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
this._textFilter = ""
}
this.textFilterTarget = target
+ this.textFilterInput.nativeElement.focus()
this.updateRules()
}
}