(node: HTMLElement, smooth?: boolean)
| 1 | export function scrollToBottom(node: HTMLElement, smooth?: boolean) { |
| 2 | if (node) { |
| 3 | if (node.scroll && smooth) { |
| 4 | node.scroll({ |
| 5 | top: node.scrollHeight, |
| 6 | behavior: 'smooth', |
| 7 | }); |
| 8 | } else { |
| 9 | node.scrollTop = node.scrollHeight; |
| 10 | } |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | export function scrollToTop(node: HTMLElement, smooth?: boolean) { |
| 15 | if (node) { |
no outgoing calls
no test coverage detected