JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.54k stars 4.12k forks source link

Scroll option into view while using portals #5663

Open pmorim opened 1 year ago

pmorim commented 1 year ago

Description

I've stumbled upon a bug where the "scroll option into view" feature does not work for portaled menus. Although, it seems to work fine for non-portaled menus.

Affected Versions

I've found this issue to have been introduced in v4, and it is still present in v5.

Screen recording

a gif of the bug

How to reproduce the bug

What is the expected behavior

The menu should scroll back to the selected option

Notes

I have taken a look into the code and did not manage to find the issue. I wouldn't mind doing the PR myself if anyone can manage to point me in the right direction.