From c3b87fd5d44c18a164814084ea67a8e2f3f77562 Mon Sep 17 00:00:00 2001 From: Ayuka Date: Tue, 12 Dec 2023 14:00:37 +0300 Subject: [PATCH] recalculate menu placement on options length https://github.com/JedWatson/react-select/issues/5642 --- packages/react-select/src/components/Menu.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-select/src/components/Menu.tsx b/packages/react-select/src/components/Menu.tsx index 7483fa045e..07d0c90dd6 100644 --- a/packages/react-select/src/components/Menu.tsx +++ b/packages/react-select/src/components/Menu.tsx @@ -323,6 +323,7 @@ export const MenuPlacer = < menuPosition, menuShouldScrollIntoView, theme, + options: { length: optionsLength }, } = props; const { setPortalPlacement } = useContext(PortalPlacementContext) || {}; @@ -360,6 +361,7 @@ export const MenuPlacer = < minMenuHeight, setPortalPlacement, controlHeight, + optionsLength, ]); return children({