MCPcopy Create free account
hub / github.com/caseywebdev/react-list / defaultScrollParentGetter

Function defaultScrollParentGetter

src/react-list.js:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43};
44
45const defaultScrollParentGetter = component => {
46 const { axis } = component.props;
47 let el = component.getEl();
48 const overflowKey = OVERFLOW_KEYS[axis];
49 while ((el = el.parentElement)) {
50 switch (window.getComputedStyle(el)[overflowKey]) {
51 case 'auto':
52 case 'scroll':
53 case 'overlay':
54 return el;
55 }
56 }
57 return window;
58};
59
60const defaultScrollParentViewportSizeGetter = component => {
61 const { axis } = component.props;

Callers

nothing calls this directly

Calls 1

getElMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…