From 2a3820fc5a549dc526c2a45cb0ab492b7e423fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Wed, 5 Jun 2024 13:52:23 +0200 Subject: [PATCH] Fix record list filter closing when deleting last filter --- .../components/Common/RecordListFilter.vue | 10 +++----- .../components/PageBlocks/RecordListBase.vue | 25 +++---------------- 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/client/web/compose/src/components/Common/RecordListFilter.vue b/client/web/compose/src/components/Common/RecordListFilter.vue index 807df9164..ff16dfa6b 100644 --- a/client/web/compose/src/components/Common/RecordListFilter.vue +++ b/client/web/compose/src/components/Common/RecordListFilter.vue @@ -566,12 +566,8 @@ export default { } }, - onSetFocus (groupIndex, index) { - let focusIndex = this.$refs.delete.findIndex(r => r.id === `${groupIndex}-${index}`) - if (focusIndex > 0) { - focusIndex-- - } - this.$refs.delete[focusIndex].focus() + onSetFocus () { + this.$refs.focusMe.focus() }, onOpen () { @@ -611,6 +607,8 @@ export default { // If no filterGroups, add default if (!this.componentFilter.length) { this.componentFilter.push(this.createDefaultFilterGroup(undefined, this.selectedField)) + } else if (!this.inFilter) { + this.addFilter(0) } }, diff --git a/client/web/compose/src/components/PageBlocks/RecordListBase.vue b/client/web/compose/src/components/PageBlocks/RecordListBase.vue index 73c6d6a56..65fcfeafe 100644 --- a/client/web/compose/src/components/PageBlocks/RecordListBase.vue +++ b/client/web/compose/src/components/PageBlocks/RecordListBase.vue @@ -733,7 +733,6 @@