MCPcopy Create free account
hub / github.com/UI5/webcomponents / findVerticalScrollContainer

Function findVerticalScrollContainer

packages/main/src/TableUtils.ts:19–34  ·  view source on GitHub ↗
(element: HTMLElement)

Source from the content-addressed store, hash-verified

17};
18
19const findVerticalScrollContainer = (element: HTMLElement): HTMLElement => {
20 while (element) {
21 const { overflowY } = window.getComputedStyle(element);
22 if (overflowY === "auto" || overflowY === "scroll") {
23 return element;
24 }
25
26 if (element.parentNode instanceof ShadowRoot) {
27 element = element.parentNode.host as HTMLElement;
28 } else {
29 element = element.parentElement as HTMLElement;
30 }
31 }
32
33 return document.scrollingElement as HTMLElement || document.documentElement;
34};
35
36const scrollElementIntoView = (scrollContainer: HTMLElement, element: HTMLElement, stickyElements: HTMLElement[], isRtl: boolean) => {
37 if (stickyElements.length === 0) {

Callers 2

_scrollContainerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…