MCPcopy Create free account
hub / github.com/bugy/script-server / findScrollableParent

Function findScrollableParent

web-src/src/common/utils/common.js:504–515  ·  view source on GitHub ↗
(elem)

Source from the content-addressed store, hash-verified

502}
503
504function findScrollableParent(elem) {
505 let scrollableParent = elem.parentNode;
506 while (!isNull(scrollableParent)) {
507 if (scrollableParent.scrollHeight > scrollableParent.clientHeight) {
508 return scrollableParent;
509 }
510
511 scrollableParent = scrollableParent.parentNode;
512 }
513
514 return scrollableParent;
515}
516
517function isVisibleOnScroll(elem, partially = true) {
518 let scrollableParent = findScrollableParent(elem);

Callers 2

scrollToElementFunction · 0.85
isVisibleOnScrollFunction · 0.85

Calls 1

isNullFunction · 0.85

Tested by

no test coverage detected