MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / findScrollContainer

Method findScrollContainer

src/utils/VirtualScroller.ts:197–214  ·  view source on GitHub ↗
(element: HTMLElement)

Source from the content-addressed store, hash-verified

195 }
196
197 private findScrollContainer(element: HTMLElement): HTMLElement {
198 let current: HTMLElement | null = element;
199
200 // Walk up the DOM tree to find an element with overflow scroll/auto
201 while (current) {
202 const style = window.getComputedStyle(current);
203 const overflowY = style.overflowY;
204
205 if (overflowY === "scroll" || overflowY === "auto") {
206 return current;
207 }
208
209 current = current.parentElement;
210 }
211
212 // Fallback to container itself
213 return element;
214 }
215
216 private getContainerBottomPadding(): number {
217 const view = this.container.ownerDocument.defaultView;

Callers 1

setupDOMMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected