Skip to content

defaultMenuIsOpen doesn't work with menuPortalTarget #4749

@mthorning

Description

@mthorning

Hi, we're using v4.3.1 and wish to load the select with the menu open. We're using the component like this:

<ReactSelect defaultMenuIsOpen menuPortalTarget={document.body} />

The component doesn't render with the menu open. It does work if I remove the menuPortalTarget prop.
I've had a look at the source code and it looks like there's a race condition with the MenuPortal component and the controlRef. I'll create a PR for you to take a look at.

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/bug-confirmedIssues about a bug that has been confirmed by a maintainerissue/has-prIssue has a PR attached to it that may solve the issuemenu-bugAddresses menu positioning, scrolling, or general interactions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions