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

menuPlacement=auto is not recalculated when options change after menu is opened #5642

Open
joshhunt opened this issue May 22, 2023 · 1 comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet

Comments

@joshhunt
Copy link

When using AsyncSelect with menuPosition="auto" towards the bottom of the page, once the options load the menu will be off screen.

image

It appears the menu position is not recalculated if the options/size of the menu changes after its opened.

const state = getMenuPlacement({
maxHeight: maxMenuHeight,
menuEl,
minHeight: minMenuHeight,
placement: menuPlacement,
shouldScroll,
isFixedPosition,
controlHeight,
});
setMaxHeight(state.maxHeight);
setPlacement(state.placement);
setPortalPlacement?.(state.placement);
}, [
maxMenuHeight,
menuPlacement,
menuPosition,
menuShouldScrollIntoView,
minMenuHeight,
setPortalPlacement,
controlHeight,
]);

Reproduction sandbox https://codesandbox.io/s/react-select-menuplacement-repro-wqkuew?file=/src/App.js https://wqkuew.csb.app/

@joshhunt joshhunt added the issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet label May 22, 2023
@ayuka-bg
Copy link

ayuka-bg commented Dec 1, 2023

same here

ayuka-bg added a commit to ayuka-bg/react-select that referenced this issue Dec 12, 2023
Julusian pushed a commit to Julusian/react-select that referenced this issue Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet
Projects
None yet
Development

No branches or pull requests

2 participants