MCPcopy Create free account
hub / github.com/angular/components / isElementScrolledOutsideView

Function isElementScrolledOutsideView

src/cdk/overlay/position/scroll-clip.ts:22–31  ·  view source on GitHub ↗
(element: Dimensions, scrollContainers: Dimensions[])

Source from the content-addressed store, hash-verified

20 * @docs-private
21 */
22export function isElementScrolledOutsideView(element: Dimensions, scrollContainers: Dimensions[]) {
23 return scrollContainers.some(containerBounds => {
24 const outsideAbove = element.bottom < containerBounds.top;
25 const outsideBelow = element.top > containerBounds.bottom;
26 const outsideLeft = element.right < containerBounds.left;
27 const outsideRight = element.left > containerBounds.right;
28
29 return outsideAbove || outsideBelow || outsideLeft || outsideRight;
30 });
31}
32
33/**
34 * Gets whether an element is clipped by any of its scrolling containers.

Callers 2

_getScrollVisibilityMethod · 0.90
enableMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected