From 818eb2eb86f9b113362655cca3ee37b892f079f5 Mon Sep 17 00:00:00 2001 From: liangjunqi Date: Mon, 4 Nov 2024 16:23:52 +0800 Subject: [PATCH] fix: activeBar offset not right when start from the opposite direction --- src/PickerInput/Selector/RangeSelector.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PickerInput/Selector/RangeSelector.tsx b/src/PickerInput/Selector/RangeSelector.tsx index 7cd36bd29..70894a011 100644 --- a/src/PickerInput/Selector/RangeSelector.tsx +++ b/src/PickerInput/Selector/RangeSelector.tsx @@ -187,10 +187,10 @@ function RangeSelector( 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); }