()
| 120 | } |
| 121 | |
| 122 | private setupDOM(): void { |
| 123 | // Clear existing content |
| 124 | this.container.empty(); |
| 125 | |
| 126 | // Container should just be relative, parent handles overflow |
| 127 | this.container.classList.remove("tn-static-margin-top-12px-91e0f558"); |
| 128 | this.container.classList.add("tn-static-position-relative-d461c96d"); |
| 129 | |
| 130 | // Create spacer to maintain scroll height |
| 131 | this.spacer = this.container.createDiv({ |
| 132 | cls: "virtual-scroller__spacer", |
| 133 | }); |
| 134 | this.spacer.style.cssText = ` |
| 135 | position: absolute; |
| 136 | top: 0; |
| 137 | left: 0; |
| 138 | right: 0; |
| 139 | pointer-events: none; |
| 140 | `; |
| 141 | this.updateSpacerHeight(); |
| 142 | |
| 143 | // Create content container for rendered items |
| 144 | this.contentContainer = this.container.createDiv({ |
| 145 | cls: "virtual-scroller__content", |
| 146 | }); |
| 147 | this.contentContainer.style.cssText = ` |
| 148 | position: relative; |
| 149 | `; |
| 150 | |
| 151 | // Find the actual scrolling container by walking up the DOM |
| 152 | this.scrollContainer = this.findScrollContainer(this.container); |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Calculate estimated height by measuring a sample of items |
no test coverage detected