From c174d0a99e6bc397fdf36ea1d926b82159ed24cd Mon Sep 17 00:00:00 2001 From: Rocky Chan Date: Fri, 19 Apr 2024 12:03:46 +0800 Subject: [PATCH] Determine auto dropdown position by half of the screen height --- src/components/Dropdown/index.tsx | 4 ++-- src/components/MultiSelect/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Dropdown/index.tsx b/src/components/Dropdown/index.tsx index c6125da..34f4c14 100644 --- a/src/components/Dropdown/index.tsx +++ b/src/components/Dropdown/index.tsx @@ -568,7 +568,7 @@ const DropdownComponent: ( return bottom < keyboardHeight + height; } - return bottom < (search ? 150 : 100); + return bottom < (H * 0.5); }; if (width && top && bottom) { @@ -645,8 +645,8 @@ const DropdownComponent: ( } return null; }, [ + H, visible, - search, position, keyboardHeight, maxHeight, diff --git a/src/components/MultiSelect/index.tsx b/src/components/MultiSelect/index.tsx index ee37a13..6e800dd 100644 --- a/src/components/MultiSelect/index.tsx +++ b/src/components/MultiSelect/index.tsx @@ -559,7 +559,7 @@ const MultiSelectComponent: ( return bottom < keyboardHeight + height; } - return bottom < (search ? 150 : 100); + return bottom < (H * 0.5); }; if (width && top && bottom) { @@ -636,8 +636,8 @@ const MultiSelectComponent: ( } return null; }, [ + H, visible, - search, position, keyboardHeight, maxHeight,