Skip to content

Commit

Permalink
fix: activeBar offset not right when start from the opposite direction (
Browse files Browse the repository at this point in the history
#889)

Co-authored-by: liangjunqi <liangjunqi@hmntech.com>
  • Loading branch information
Dmaziyo and liangjunqi authored Nov 7, 2024
1 parent 6db0043 commit 8eb62b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PickerInput/Selector/RangeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ function RangeSelector<DateType extends object = any>(
const { offsetWidth, offsetLeft, offsetParent } = input.nativeElement;
const parentWidth = (offsetParent as HTMLElement)?.offsetWidth || 0;
const activeOffset = placementRight ? (parentWidth - offsetWidth - offsetLeft) : offsetLeft;
setActiveBarStyle((ori) => ({
...ori,
setActiveBarStyle(({ insetInlineStart, insetInlineEnd, ...rest }) => ({
...rest,
width: offsetWidth,
[offsetUnit]: activeOffset,
[offsetUnit]: activeOffset
}));
onActiveOffset(activeOffset);
}
Expand Down

0 comments on commit 8eb62b2

Please sign in to comment.