Skip to content

Commit 8eb62b2

Browse files
Dmaziyoliangjunqi
and
liangjunqi
authored
fix: activeBar offset not right when start from the opposite direction (#889)
Co-authored-by: liangjunqi <[email protected]>
1 parent 6db0043 commit 8eb62b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/PickerInput/Selector/RangeSelector.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ function RangeSelector<DateType extends object = any>(
187187
const { offsetWidth, offsetLeft, offsetParent } = input.nativeElement;
188188
const parentWidth = (offsetParent as HTMLElement)?.offsetWidth || 0;
189189
const activeOffset = placementRight ? (parentWidth - offsetWidth - offsetLeft) : offsetLeft;
190-
setActiveBarStyle((ori) => ({
191-
...ori,
190+
setActiveBarStyle(({ insetInlineStart, insetInlineEnd, ...rest }) => ({
191+
...rest,
192192
width: offsetWidth,
193-
[offsetUnit]: activeOffset,
193+
[offsetUnit]: activeOffset
194194
}));
195195
onActiveOffset(activeOffset);
196196
}

0 commit comments

Comments
 (0)