Skip to content

Select menu portal does not move after selection several options #5403

@antollika

Description

@antollika

I have this example
https://codesandbox.io/s/react-select-v5-sandbox-forked-c0rzsm?file=/example.js

the main configuration for this select is (I need each of them)

isMulti
closeMenuOnSelect={false}
menuPosition="fixed"

The problem is - I select several options and control height increases but the menu is not moving bottom with control bottom line.

If I have menuPosition="absolute" everything is fine but I can not use it because this select can be in the parent with overflow: auto and it will overflow my select menu

I have only one solution - pass a new key to MenuPortal component when the select value is changing but it causes performance issue with the long list and the main problem - React will re-create the component because of new key property and if I scrolled down - scroll will be returned to the start position

And the most interesting thing - Before 5.5.0 -> we had an issue that when I had fixed menu -> it did not scrolled with the control but now it is fixed and scrolling down in the example forces menu portal position and its going to the right place

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions