From 3065ade76292100718b1deea191124f1a9edc679 Mon Sep 17 00:00:00 2001 From: misbiheyv Date: Wed, 23 Oct 2024 15:37:11 +1000 Subject: [PATCH 1/2] fix: wait container ref --- .../b-virtual-scroll-new/b-virtual-scroll-new.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/base/b-virtual-scroll-new/b-virtual-scroll-new.ts b/src/components/base/b-virtual-scroll-new/b-virtual-scroll-new.ts index cd3dca7998..2ce3cd0606 100644 --- a/src/components/base/b-virtual-scroll-new/b-virtual-scroll-new.ts +++ b/src/components/base/b-virtual-scroll-new/b-virtual-scroll-new.ts @@ -505,7 +505,7 @@ class bVirtualScrollNew extends iVirtualScrollProps implements iItems { this.componentInternalState.setIsDomInsertInProgress(true); - this.async.requestAnimationFrame(() => { + this.async.requestAnimationFrame(async () => { const state = this.getVirtualScrollState(); @@ -515,7 +515,9 @@ class bVirtualScrollNew extends iVirtualScrollProps implements iItems { this.slotsStateController.loadingProgressState(); } - this.$refs.container.appendChild(fragment); + const container = await this.waitRef('container'); + + container.appendChild(fragment); this.componentInternalState.setIsDomInsertInProgress(false); this.onDomInsertDone(); @@ -541,14 +543,16 @@ class bVirtualScrollNew extends iVirtualScrollProps implements iItems { const asyncGroup = bVirtualScrollNewFirstChunkRenderAsyncGroup; - this.nextTick({label: $$.firstChunkRender, group: asyncGroup}).then(() => { + this.nextTick({label: $$.firstChunkRender, group: asyncGroup}).then(async () => { this.componentInternalState.setIsDomInsertInProgress(false); let itemsForMount: Array = []; if (!SSR) { + const container = await this.waitRef('container'); + itemsForMount = this.componentFactory - .produceMounted(items, Array.from(this.$refs.container.children)); + .produceMounted(items, Array.from(container.children)); } this.observer.observe(itemsForMount); From c89cdda7af0b5c4199872b4439c5cec5b048ba39 Mon Sep 17 00:00:00 2001 From: misbiheyv Date: Wed, 23 Oct 2024 15:42:10 +1000 Subject: [PATCH 2/2] docs: add CHANGELOG --- CHANGELOG.md | 6 ++++++ src/components/base/b-virtual-scroll-new/CHANGELOG.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9304e8d88f..812f8f1a19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ Changelog _Note: Gaps between patch versions are faulty, broken or test releases._ +## v4.0.0-beta.?? (2024-??-??) + +#### :bug: Bug Fix + +* Replaced `$refs.container` with `waitRef('container')`. + ## v4.0.0-beta.146 (2024-10-18) #### :bug: Bug Fix diff --git a/src/components/base/b-virtual-scroll-new/CHANGELOG.md b/src/components/base/b-virtual-scroll-new/CHANGELOG.md index 089dcdf9e9..6a5fefa91b 100644 --- a/src/components/base/b-virtual-scroll-new/CHANGELOG.md +++ b/src/components/base/b-virtual-scroll-new/CHANGELOG.md @@ -9,6 +9,12 @@ Changelog > - :house: [Internal] > - :nail_care: [Polish] +## v4.0.0-beta.?? (2024-??-??) + +#### :bug: Bug Fix + +* Replaced `$refs.container` with `waitRef('container')`. + ## v4.0.0-beta.114 (2024-07-24) #### :house: Internal