Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #5733: MenuPlacer useLayoutEffect depend on isLoading #5736

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions packages/react-select/src/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,10 @@ export const MenuPlacer = <
menuPlacement,
menuPosition,
menuShouldScrollIntoView,
selectProps,
theme,
} = props;
const { isLoading } = selectProps;

const { setPortalPlacement } = useContext(PortalPlacementContext) || {};
const ref = useRef<HTMLDivElement | null>(null);
Expand Down Expand Up @@ -353,6 +355,7 @@ export const MenuPlacer = <
setPlacement(state.placement);
setPortalPlacement?.(state.placement);
}, [
isLoading,
maxMenuHeight,
menuPlacement,
menuPosition,
Expand Down