(
container: HTMLElement | null,
userScrolledUp: { current: boolean },
)
| 191 | } |
| 192 | |
| 193 | function settleScrollBottom( |
| 194 | container: HTMLElement | null, |
| 195 | userScrolledUp: { current: boolean }, |
| 196 | ) { |
| 197 | if (!container || userScrolledUp.current) { |
| 198 | return; |
| 199 | } |
| 200 | const distanceFromBottom = |
| 201 | container.scrollHeight - container.scrollTop - container.clientHeight; |
| 202 | if (distanceFromBottom < 120) { |
| 203 | easeScrollToBottom(container, 0.35); |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | export default function App() { |
| 208 | const [msgs, setMsgs] = useState<Message[]>([ |
no test coverage detected