Skip to content

Commit

Permalink
fix: range hover logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Feb 17, 2023
1 parent 0540666 commit 7938249
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/panels/WeekPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ function WeekPanel<DateType>(props: WeekPanelProps<DateType>) {
const { rangedValue, hoverRangedValue } = React.useContext(RangeContext);
const { onDateMouseEnter, onDateMouseLeave } = React.useContext(PanelContext);

const rangeStart = rangedValue?.[0] || hoverRangedValue?.[0];
const rangeEnd = rangedValue?.[1] || hoverRangedValue?.[1];
const rangeStart = hoverRangedValue?.[0] || rangedValue?.[0];
const rangeEnd = hoverRangedValue?.[1] || rangedValue?.[1];

// Render additional column
const cellPrefixCls = `${prefixCls}-cell`;
Expand Down
2 changes: 0 additions & 2 deletions tests/range.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1756,8 +1756,6 @@ describe('Picker.Range', () => {
return Array.from(list).find((cell) => cell.textContent == val);
}

console.log(document.body.innerHTML);

// Start
fireEvent.mouseEnter(findWeekCell('35'));
fireEvent.click(findWeekCell('35'));
Expand Down

0 comments on commit 7938249

Please sign in to comment.