@internal returns the passed element if vertically scrollable, else the closest parent that will, up to the entire document scrolling element
(el?: HTMLElement)
| 571 | |
| 572 | /** @internal returns the passed element if vertically scrollable, else the closest parent that will, up to the entire document scrolling element */ |
| 573 | static getScrollElement(el?: HTMLElement): HTMLElement { |
| 574 | if (!el) return document.scrollingElement as HTMLElement || document.documentElement; // IE support |
| 575 | const overflowY = getComputedStyle(el).overflowY; |
| 576 | if ((overflowY === 'auto' || overflowY === 'scroll') && el.scrollHeight > el.clientHeight) { |
| 577 | return el; |
| 578 | } else { |
| 579 | return Utils.getScrollElement(el.parentElement); |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | /** |
| 584 | * @internal Function used to scroll the page. |
no outgoing calls
no test coverage detected