Skip to content
Bug reportNov 10, 2026· 0:44· 9 views

react-select 5.9.0: portaled menu opens at top of list instead of scrolling to the selected option

0:44 total

Comments · 0

Be the first to comment.

Bug reportby SceneRecap AI

mediumreact-select menu scroll-into-view logic when the menu is rendered via menuPortalTarget. The scroll to the selected option on menu open may run before the portaled menu list is mounted or measured, or it may target the wrong scroll container.
os: macOSdpr: 1locale: en-USbrowser: Chromium 151.0.7922.34library: react-select 5.9.0timezone: Europe/Berlinviewport: 1280x720issue_ref: #5775

Repro steps

  1. 1.Open the demo page. The left select is portaled (menuPortalTarget={document.body}) and the right select is standard.
  2. 2.Click the 'bug portaled select' combobox to open the menu.
  3. 3.Click the option 'Silver', which is near the bottom of the list.
  4. 4.Press Escape to close the menu.
  5. 5.Click the 'bug portaled select reopen' combobox to re-open the menu.
  6. 6.Look at the menu. It starts at 'Ocean' and Silver is not visible.

Expected

When the portaled menu re-opens, it should scroll so the selected option 'Silver' is visible. The page reports this behaviour for the standard (non-portaled) select.

Actual

The portaled menu re-opens at the top of the list with 'Ocean' highlighted. The selected option 'Silver' is off-screen. A console warning reports that the first visible option is "Ocean" while Silver is selected.

Evidence

consoleWarning: react-select#5775: portaled menu re-opened, first visible option: "Ocean" (selected: Silver, bug if topText !== Silver).
visualRed banner reads 'Bug: re-opened at Ocean, Silver (selected) off-screen'. Ocean is highlighted at the top of the portaled menu.
visualPortaled menu shows Ocean through Slate with Slate highlighted. Silver is not visible.
visualAfter Silver was selected and the menu closed, the left select still shows the placeholder 'Select a colour...'.
visualControl case: on re-open of the standard select, a green banner reads 'Control: menu scrolled to Silver, correct behaviour'. The page reports the control as working.
visualCaveat on the control: the visible control menu lists Ocean through Slate with Red highlighted. Silver itself is not visible in the captured frames at 35.0s and 37.0s.
visualBoth banners are shown side by side: red bug banner on the portaled select, green control banner on the standard select.
Issue markdown (copy-paste ready)
## Summary
With react-select 5.9.0 and `menuPortalTarget={document.body}`, re-opening the menu does not scroll to the selected option. The menu always opens at the top option 'Ocean', so the selected option 'Silver' is off-screen. A standard (non-portaled) select with the same options is shown as a control. The page reports that the control scrolls to Silver.

## Environment
- react-select 5.9.0 (issue #5775)
- Chromium 151.0.7922.34, macOS
- Viewport 1280x720, DPR 1

## Steps to reproduce
1. Open the demo page. The left select is portaled and the right select is standard (1.0s).
2. Click the 'bug portaled select' combobox (7.9s).
3. Click the option 'Silver' near the bottom of the list (12.0s).
4. Press Escape (16.0s).
5. Click the combobox again to re-open it (17.6s).

## Expected
The re-opened menu scrolls so that 'Silver' is visible. The page reports this behaviour for the standard select.

## Actual
The menu opens at the top with 'Ocean' highlighted. 'Silver' is not visible (19.0s, 21.0s).

## Evidence
- 18.8s console warn: `react-select#5775: portaled menu re-opened, first visible option: "Ocean" (selected: Silver, bug if topText !== Silver)`
- 19.0s: red banner 'Bug: re-opened at Ocean, Silver (selected) off-screen'. Ocean is highlighted at the top.
- 21.0s: menu shows Ocean through Slate. Silver is not visible.
- 17.0s: the left select still shows the placeholder after Silver was selected.

## Control (works)
- 27.8s to 30.6s: the standard select is opened and 'Silver control' is clicked.
- 35.0s: on re-open, a green banner reads 'Control: menu scrolled to Silver, correct behaviour'.
- Note: the captured frames at 35.0s and 37.0s show Ocean through Slate with Red highlighted. Silver itself is not visible in those frames. The pass result for the control comes from the page banner.

## Suspected area
The scroll-into-view logic on menu open when the menu is rendered through `menuPortalTarget`. The scroll may run before the portaled menu list is mounted, or it may target the wrong scroll container.

*Recorded with SceneRecap.*

Your recordings could explain themselves too.

Free plan · silent recordings welcome · bug reports included.

Try SceneRecap free →
react-select 5.9.0: portaled menu opens at top of list instead of scrolling to the selected option · SceneRecap