fix: treat very close mouse positions to end of scrubber as the actual end of scrubber

pull/23922/head
midzelis 2025-11-15 15:30:05 +00:00
parent e94eb5012f
commit f4af8ae5f2
1 changed files with 2 additions and 1 deletions

View File

@ -326,6 +326,7 @@
const lower = 0;
const upper = rect?.height - (PADDING_TOP + PADDING_BOTTOM);
hoverY = clamp(clientY - rect?.top - PADDING_TOP, lower, upper);
const hoverAtScrubberBottom = hoverY === rect?.height - (PADDING_TOP + PADDING_BOTTOM);
const x = rect!.left + rect!.width / 2;
const { segment, monthGroupPercentY, isOnPaddingTop, isOnPaddingBottom } = getActive(x, clientY);
activeSegment = segment;
@ -334,7 +335,7 @@
const scrubData = {
scrubberMonth: segmentDate,
overallScrollPercent: toTimelineY(hoverY),
overallScrollPercent: hoverAtScrubberBottom ? 1 : toTimelineY(hoverY),
scrubberMonthScrollPercent: monthGroupPercentY,
};
if (wasDragging === false && isDragging) {