( target: ScrollTarget, direction: Direction )
| 39 | } |
| 40 | |
| 41 | export function getMaxScrollPosition( |
| 42 | target: ScrollTarget, |
| 43 | direction: Direction |
| 44 | ): number { |
| 45 | const element = isWindow(target) |
| 46 | ? (target.document.scrollingElement ?? target.document.documentElement) |
| 47 | : target; |
| 48 | |
| 49 | return direction === "vertical" |
| 50 | ? element.scrollHeight - element.clientHeight |
| 51 | : element.scrollWidth - element.clientWidth; |
| 52 | } |
| 53 | |
| 54 | export function scrollTargetTo( |
| 55 | target: ScrollTarget | null, |
no test coverage detected