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

Select not scrolling to Selected Item when menuPortalTarget={document.body} #5926

Open
jfishymlb opened this issue Jun 24, 2024 · 0 comments
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet

Comments

@jfishymlb
Copy link

When setting the MenuPortalTarget prop to document.body it breaks the functionality of correctly scrolling/focusing on the selected Item when it is at the bottom/out of view in the options list.
Example Code from the sandbox:
<Select className="basic-single" classNamePrefix="select" defaultValue={colourOptions[0]} isDisabled={isDisabled} isLoading={isLoading} isClearable={isClearable} isRtl={isRtl} isSearchable={isSearchable} name="color" options={colourOptions} menuPortalTarget={document.body} />

Image of Silver which is the last option not showing when it is selected and the select is opened again
Screenshot 2024-06-24 at 1 14 49 PM

Switching to menuPortalTarget={null} resolves the issue

@jfishymlb jfishymlb added the issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet label Jun 24, 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

1 participant