diff --git a/packages/nc-gui/components/virtual-cell/BelongsTo.vue b/packages/nc-gui/components/virtual-cell/BelongsTo.vue index cb4d7cf3d4..a695eb127e 100644 --- a/packages/nc-gui/components/virtual-cell/BelongsTo.vue +++ b/packages/nc-gui/components/virtual-cell/BelongsTo.vue @@ -121,7 +121,7 @@ watch([listItemsDlg], () => { /> - - + - import { computed } from '@vue/reactivity' import type { ColumnType } from 'nocodb-sdk' -import { ref } from 'vue' import type { Ref } from 'vue' +import { ref } from 'vue' import { ActiveCellInj, CellValueInj, ColumnInj, IsUnderLookupInj, inject, useSelectedCellKeyupListener } from '#imports' const value = inject(CellValueInj, ref(0)) @@ -151,13 +151,13 @@ watch([listItemsDlg], () => { @click.stop="openListDlg" /> - - - + - { - if (!expandedFormDlg.value) { - loadChildrenList() - } + childrenExcludedOffsetCount.value = 0 + childrenListOffsetCount.value = 0 }) /* @@ -199,6 +200,12 @@ onMounted(() => { window.addEventListener('keydown', linkedShortcuts) }) +const childrenListRef = ref() + +watch(childrenListPagination, () => { + childrenListRef.value?.scrollTo({ top: 0, behavior: 'smooth' }) +}) + onUnmounted(() => { childrenListPagination.query = '' window.removeEventListener('keydown', linkedShortcuts) @@ -208,22 +215,22 @@ onUnmounted(() => { @@ -231,10 +238,11 @@ onUnmounted(() => { { if (e.key === 'Escape') { @@ -242,39 +250,38 @@ onUnmounted(() => { } } " - @change="childrenListPagination.page = 1" > - + - + - - + + - - + + - - + + - - + + @@ -284,24 +291,28 @@ onUnmounted(() => { onClick(refRow, id)" - @click="linkOrUnLink(refRow, id)" /> - + {{ $t('msg.noLinkedRecords') }} {{ $t('msg.clickLinkRecordsToAddLinkFromTable', { tableName: relatedTableMeta?.title }) }} @@ -352,7 +363,7 @@ onUnmounted(() => { /> - {{ $t('general.finish') }} + {{ $t('general.finish') }} { -