Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element'

Ramesh Mane7b6501050f07
diff --git a/packages/nc-gui/components/smartsheet/Gallery.vue b/packages/nc-gui/components/smartsheet/Gallery.vue
index 4857f0feb5..b5c1c949ac 100644
--- a/packages/nc-gui/components/smartsheet/Gallery.vue
+++ b/packages/nc-gui/components/smartsheet/Gallery.vue
@@ -34,6 +34,8 @@ provide(IsCalendarInj, ref(false))
provide(RowHeightInj, ref(1 as const))
provide(ReloadRowDataHookInj, reloadViewDataHook!)
+const { isMounted } = useIsMounted()
+
const {
fetchChunk,
deleteRow,
@@ -470,7 +472,7 @@ const resetPointerEvent = (record: RowType, col: ColumnType) => {
>
<template v-if="galleryData?.fk_cover_image_col_id" #cover>
<a-carousel
- v-if="!reloadAttachments && attachments(record).length"
+ v-if="isMounted && !reloadAttachments && attachments(record).length"
class="gallery-carousel !border-b-1 !border-nc-border-gray-medium min-h-52 !bg-nc-bg-default"
:style="{
...extractRowBackgroundColorStyle(record).rowBgColor,
diff --git a/packages/nc-gui/components/smartsheet/Kanban.vue b/packages/nc-gui/components/smartsheet/Kanban.vue
index bd35fbf365..eb5deffbfc 100644
--- a/packages/nc-gui/components/smartsheet/Kanban.vue
+++ b/packages/nc-gui/components/smartsheet/Kanban.vue
@@ -51,6 +51,8 @@ const { metaColumnById } = useViewColumnsOrThrow(view, meta)
const { isSyncedTable, eventBus } = useSmartsheetStoreOrThrow()
+const { isMounted } = useIsMounted()
+
const {
loadKanbanData,
loadMoreKanbanData,
@@ -839,7 +841,7 @@ const resetPointerEvent = (record: RowType, col: ColumnType) => {
could reference a non-existent column. This is a workaround to handle such scenarios properly.
-->
<template v-if="coverImageColumn?.id" #cover>
- <template v-if="!reloadAttachments && attachments(record).length">
+ <template v-if="isMounted && !reloadAttachments && attachments(record).length">
<a-carousel
:key="attachments(record).reduce((acc, curr) => acc + curr?.path, '')"
class="gallery-carousel !border-b-1 !border-nc-border-gray-medium !bg-nc-bg-default"
diff --git a/packages/nc-gui/components/tabs/Smartsheet.vue b/packages/nc-gui/components/tabs/Smartsheet.vue
index 126847edb6..88cd1dc7d3 100644
--- a/packages/nc-gui/components/tabs/Smartsheet.vue
+++ b/packages/nc-gui/components/tabs/Smartsheet.vue
@@ -107,7 +107,7 @@ const actionPaneRef = ref()
* We delay rendering Splitpanes until the parent component is fully mounted
* and show a loader meanwhile to ensure DOM stability.
*/
-const isMounted = ref(false)
+const { isMounted } = useIsMounted()
const onDrop = async (event: DragEvent) => {
event.preventDefault()
@@ -264,15 +264,9 @@ const checkIfViewExists = async () => {
}
onMounted(async () => {
- isMounted.value = true
-
await checkIfViewExists()
})
-onBeforeUnmount(() => {
- isMounted.value = false
-})
-
watch(isViewsLoading, async () => {
await checkIfViewExists()
})
diff --git a/packages/nc-gui/composables/useIsMounted.ts b/packages/nc-gui/composables/useIsMounted.ts
new file mode 100644
index 0000000000..ac2079d2d5
--- /dev/null
+++ b/packages/nc-gui/composables/useIsMounted.ts
@@ -0,0 +1,17 @@
+export const useIsMounted = (options: { waitForNextTick?: boolean } = {}) => {
+ const isMounted = ref(false)
+
+ onMounted(async () => {
+ if (options.waitForNextTick) {
+ await nextTick()
+ }
+
+ isMounted.value = true
+ })
+
+ onBeforeUnmount(() => {
+ isMounted.value = false
+ })
+
+ return { isMounted }
+}