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 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);