From 9681b96644e86942fe35c9365eef638b4a5af06c Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 11 Jun 2024 19:41:59 +0800 Subject: [PATCH] fix: arrow position when placement is right again --- src/PickerInput/Popup/index.tsx | 3 +-- src/PickerInput/Selector/RangeSelector.tsx | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/PickerInput/Popup/index.tsx b/src/PickerInput/Popup/index.tsx index 846866424..1d1e0e5f1 100644 --- a/src/PickerInput/Popup/index.tsx +++ b/src/PickerInput/Popup/index.tsx @@ -208,7 +208,6 @@ export default function Popup(props: PopupProps(props: PopupProps {/* Watch for container size */} diff --git a/src/PickerInput/Selector/RangeSelector.tsx b/src/PickerInput/Selector/RangeSelector.tsx index a99d123f2..19ff9b4ca 100644 --- a/src/PickerInput/Selector/RangeSelector.tsx +++ b/src/PickerInput/Selector/RangeSelector.tsx @@ -201,8 +201,8 @@ function RangeSelector( [offsetUnit]: offset, })); const placementRight = placement?.toLowerCase().endsWith('right'); - const startOffset = placementRight ? parentElement?.offsetWidth : 0; - onActiveOffset(activeIndex === 0 ? startOffset : offset); + const diffOfTriggerWidthAndPanelWidth = parentElement.offsetWidth - offsetWidth; + onActiveOffset(placementRight ? offset + diffOfTriggerWidthAndPanelWidth : offset); } });