From 8eb62b2b533fb1e984fd11ed10507ef5b5dfc490 Mon Sep 17 00:00:00 2001 From: DctMaZiYo <74136983+Dmaziyo@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:41:53 +0800 Subject: [PATCH] fix: activeBar offset not right when start from the opposite direction (#889) Co-authored-by: liangjunqi --- 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); }