diff --git a/packages/nc-gui/components/dashboard/TreeView.vue b/packages/nc-gui/components/dashboard/TreeView.vue index bd7fbb1ffc..45947b5a76 100644 --- a/packages/nc-gui/components/dashboard/TreeView.vue +++ b/packages/nc-gui/components/dashboard/TreeView.vue @@ -240,9 +240,18 @@ function openTableCreateDialog(baseId?: string) { const searchInputRef: VNodeRef = (vnode: typeof Input) => vnode?.$el?.focus() +const beforeSearch = ref([]) + const onSearchCloseIconClick = () => { filterQuery = '' toggleSearchActive(false) + activeKey.value = beforeSearch.value +} + +const onSearchIconClick = () => { + beforeSearch.value = activeKey.value + toggleSearchActive(true) + activeKey.value = bases.value.filter((el) => el.enabled).map((el) => `collapse-${el.id}`) } const isCreateTableAllowed = computed( @@ -348,7 +357,7 @@ watch( - + @@ -611,7 +620,7 @@ watch( :class="[{ hidden: searchActive && !!filterQuery && !filteredTables?.find((el) => el.base_id === base.id) }]" expand-icon-position="right" :bordered="false" - accordion + :accordion="!searchActive" ghost >