Skip to content

defaultMenuIsOpen doesn't work with menuPortalTarget #4749

Closed

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 :)

Activity

  1. added a commit that references this issue on Sep 6, 2021
    f5d79a3
  2. mthorning commented on Sep 6, 2021

    @mthorning
    Author

    PR is here, apologies for not having created it on the right branch so that it would link automatically.

  3. Rall3n commented on Sep 6, 2021

    @Rall3n
    Contributor

    Hello @mthorning,

    could you please check if the issue still occurs with the latest beta release (react-select@5.0.0-beta.1)?

  4. added
    awaiting-author-responseIssues or PRs waiting for more information from the author
    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet
    on Sep 6, 2021
  5. mthorning commented on Sep 7, 2021

    @mthorning
    Author

    Hi @Rall3n, the same issue exists in 5.0.0-beta.1.

  6. added
    issue/has-prIssue has a PR attached to it that may solve the issue
    on Oct 5, 2021
  7. ebonow commented on Oct 20, 2021

    @ebonow
    Collaborator
  8. added
    issue/bug-confirmedIssues about a bug that has been confirmed by a maintainer
    menu-bugAddresses menu positioning, scrolling, or general interactions
    and removed
    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet
    awaiting-author-responseIssues or PRs waiting for more information from the author
    on Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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