( el: HTMLElement, thresholdPx = 24, )
| 86 | |
| 87 | /** True when the reader is within thresholdPx of the bottom edge. */ |
| 88 | export function isNearScrollBottom( |
| 89 | el: HTMLElement, |
| 90 | thresholdPx = 24, |
| 91 | ): boolean { |
| 92 | return el.scrollHeight - el.scrollTop - el.clientHeight <= thresholdPx; |
| 93 | } |
| 94 | |
| 95 | /** Default distance from bottom that re-enables stream follow. */ |
| 96 | export const DEFAULT_STREAM_SCROLL_THRESHOLD = 80; |
no outgoing calls
no test coverage detected