fix: clamp trim handle end position to timeline boundary

The right-side trim handle could be dragged past the end of the
timeline because clampSpanToBounds did not cap the computed end
value at totalMs. This adds Math.min(…, totalMs) so the handle
snaps to the timeline edge.

Fixes #393
This commit is contained in:
Murat Çelik
2026-04-09 02:02:30 +03:00
committed by Siddharth
parent 38f2044967
commit c771bf8bb9
@@ -57,7 +57,7 @@ export default function TimelineWrapper({
const duration = Math.min(Math.max(rawDuration, minDuration), totalMs);
const start = Math.max(0, Math.min(normalizedStart, totalMs - duration));
const end = start + duration;
const end = Math.min(start + duration, totalMs);
return { start, end };
},