From dfed63f748a561c5a96300737ad8fb0807829503 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 24 Sep 2024 18:48:27 +0200 Subject: [PATCH] fix(PageList): Add icon to clear the filter/search string Fixes: #1501 Signed-off-by: Jonas --- src/components/PageList.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/PageList.vue b/src/components/PageList.vue index 2eb76aead..f8acc67d1 100644 --- a/src/components/PageList.vue +++ b/src/components/PageList.vue @@ -10,7 +10,10 @@ :label="t('collectives', 'Search pages')" :value.sync="filterString" class="page-filter" - :placeholder="t('collectives', 'Search pages ...')" /> + :placeholder="t('collectives', 'Search pages ...')" + trailing-button-icon="close" + :show-trailing-button="isFilteredView" + @trailing-button-click="clearFilterString" /> -
+
+ :disable-sorting="isFilteredView"> this.sortByOrder === sortOrder }, - isFilteredview() { + isFilteredView() { return this.filterString !== '' }, @@ -351,6 +354,10 @@ export default { ...mapActions(usePagesStore, ['setPageOrder', 'toggleTemplates']), ...mapActions(useSearchStore, ['setSearchQuery']), + clearFilterString() { + this.filterString = '' + }, + /** * Change page sort order and scroll to current page *