MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / getClosestContainer

Function getClosestContainer

lib/utils/test/scrollElement.ts:95–106  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

93}
94
95function getClosestContainer(element: Element): Element | null {
96 for (
97 let node = element.parentElement;
98 node !== null;
99 node = node.parentElement
100 ) {
101 if (containerRects.has(node)) {
102 return node;
103 }
104 }
105 return null;
106}
107
108function getBoundingClientRect(this: Element): DOMRect {
109 const containerRect = containerRects.get(this);

Callers 1

getBoundingClientRectFunction · 0.85

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected