From: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date: Sat, 19 Mar 2022 06:30:26 +0000 (-0700)
Subject: Allow shorter search strings with Enter key
X-Git-Tag: beta-1.6.1~65^2
X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F442%2Fhead;p=thirdparty%2Fpaperless-ngx.git
Allow shorter search strings with Enter key
---
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 892947ae49..61214d085e 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 4d0ff7c17e..b222597fbc 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
@@ -427,11 +427,7 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
distinctUntilChanged(),
filter((query) => !query.length || query.length > 2)
)
- .subscribe((text) => {
- this._textFilter = text
- this.documentService.searchQuery = text
- this.updateRules()
- })
+ .subscribe((text) => this.updateTextFilter(text))
if (this._textFilter) this.documentService.searchQuery = this._textFilter
}
@@ -476,6 +472,21 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
this.documentTypeSelectionModel.apply()
}
+ updateTextFilter(text) {
+ this._textFilter = text
+ this.documentService.searchQuery = text
+ this.updateRules()
+ }
+
+ textFilterEnter() {
+ const filterString = (
+ this.textFilterInput.nativeElement as HTMLInputElement
+ ).value
+ if (filterString.length) {
+ this.updateTextFilter(filterString)
+ }
+ }
+
changeTextFilterTarget(target) {
if (
this.textFilterTarget == TEXT_FILTER_TARGET_FULLTEXT_MORELIKE &&