()
| 58 | const frameInterval = ANIMATION_FRAME_INTERVAL_MS |
| 59 | |
| 60 | const animate = () => { |
| 61 | const elapsed = Date.now() - startTime |
| 62 | const progress = Math.min(elapsed / duration, 1) |
| 63 | const easedProgress = easeOutCubic(progress) |
| 64 | const newScroll = startScroll + distance * easedProgress |
| 65 | |
| 66 | programmaticScrollRef.current = true |
| 67 | scrollbox.scrollTop = newScroll |
| 68 | |
| 69 | if (progress < 1) { |
| 70 | animationFrameRef.current = setTimeout(animate, frameInterval) as any |
| 71 | } else { |
| 72 | animationFrameRef.current = null |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | animate() |
| 77 | }, |
no test coverage detected