fix: treat very close mouse positions to end of scrubber as the actual end of scrubber
parent
e94eb5012f
commit
f4af8ae5f2
|
|
@ -326,6 +326,7 @@
|
||||||
const lower = 0;
|
const lower = 0;
|
||||||
const upper = rect?.height - (PADDING_TOP + PADDING_BOTTOM);
|
const upper = rect?.height - (PADDING_TOP + PADDING_BOTTOM);
|
||||||
hoverY = clamp(clientY - rect?.top - PADDING_TOP, lower, upper);
|
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 x = rect!.left + rect!.width / 2;
|
||||||
const { segment, monthGroupPercentY, isOnPaddingTop, isOnPaddingBottom } = getActive(x, clientY);
|
const { segment, monthGroupPercentY, isOnPaddingTop, isOnPaddingBottom } = getActive(x, clientY);
|
||||||
activeSegment = segment;
|
activeSegment = segment;
|
||||||
|
|
@ -334,7 +335,7 @@
|
||||||
|
|
||||||
const scrubData = {
|
const scrubData = {
|
||||||
scrubberMonth: segmentDate,
|
scrubberMonth: segmentDate,
|
||||||
overallScrollPercent: toTimelineY(hoverY),
|
overallScrollPercent: hoverAtScrubberBottom ? 1 : toTimelineY(hoverY),
|
||||||
scrubberMonthScrollPercent: monthGroupPercentY,
|
scrubberMonthScrollPercent: monthGroupPercentY,
|
||||||
};
|
};
|
||||||
if (wasDragging === false && isDragging) {
|
if (wasDragging === false && isDragging) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue