Skip to content

Commit 7938249

Browse files
committed
fix: range hover logic
1 parent 0540666 commit 7938249

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/panels/WeekPanel/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ function WeekPanel<DateType>(props: WeekPanelProps<DateType>) {
1414
const { rangedValue, hoverRangedValue } = React.useContext(RangeContext);
1515
const { onDateMouseEnter, onDateMouseLeave } = React.useContext(PanelContext);
1616

17-
const rangeStart = rangedValue?.[0] || hoverRangedValue?.[0];
18-
const rangeEnd = rangedValue?.[1] || hoverRangedValue?.[1];
17+
const rangeStart = hoverRangedValue?.[0] || rangedValue?.[0];
18+
const rangeEnd = hoverRangedValue?.[1] || rangedValue?.[1];
1919

2020
// Render additional column
2121
const cellPrefixCls = `${prefixCls}-cell`;

tests/range.spec.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,8 +1756,6 @@ describe('Picker.Range', () => {
17561756
return Array.from(list).find((cell) => cell.textContent == val);
17571757
}
17581758

1759-
console.log(document.body.innerHTML);
1760-
17611759
// Start
17621760
fireEvent.mouseEnter(findWeekCell('35'));
17631761
fireEvent.click(findWeekCell('35'));

0 commit comments

Comments
 (0)