Skip to content

Commit

Permalink
Issue JedWatson#5733: MenuPlacer useLayoutEffect depend on isLoading
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-nicka committed Aug 22, 2023
1 parent 011a9d9 commit b7b335a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-select/src/Select.tsx
Expand Up @@ -1961,7 +1961,7 @@ export default class Select<
};

const menuElement = (
<MenuPlacer {...commonProps} {...menuPlacementProps}>
<MenuPlacer {...commonProps} {...menuPlacementProps} isLoading={isLoading}>
{({ ref, placerProps: { placement, maxHeight } }) => (
<Menu
{...commonProps}
Expand Down
3 changes: 3 additions & 0 deletions packages/react-select/src/components/Menu.tsx
Expand Up @@ -266,6 +266,7 @@ export interface MenuPlacerProps<
MenuPlacementProps {
/** The children to be rendered. */
children: (childrenProps: ChildrenProps) => ReactElement;
isLoading: boolean;
}

function alignToControl(placement: CoercedMenuPlacement) {
Expand Down Expand Up @@ -317,6 +318,7 @@ export const MenuPlacer = <
) => {
const {
children,
isLoading,
minMenuHeight,
maxMenuHeight,
menuPlacement,
Expand Down Expand Up @@ -353,6 +355,7 @@ export const MenuPlacer = <
setPlacement(state.placement);
setPortalPlacement?.(state.placement);
}, [
isLoading,
maxMenuHeight,
menuPlacement,
menuPosition,
Expand Down

0 comments on commit b7b335a

Please sign in to comment.