fuselage icon indicating copy to clipboard operation
fuselage copied to clipboard

Select dropdown remains viewport-positioned due to Popover Overlay (feature discussion)

Open KanhaiyaPandey opened this issue 9 months ago • 2 comments

Hi šŸ‘‹

While working on rocket.chat/rocket.chat, I noticed that the Select component renders its dropdown inside Popover, which internally uses Overlay from react-aria.

Since Overlay renders via a portal to document.body, the dropdown remains viewport-positioned and does not scroll with its container.

From tracing the implementation, the flow looks like this:

Select → SelectAria → Popover → Overlay (react-aria)

This appears to be intentional behavior from react-aria. However, in certain layouts (for example, scrollable settings pages), the dropdown can feel visually detached from the scroll container.

Would it make sense to optionally expose a positioning strategy on Popover (e.g., fixed vs absolute) so components like Select can render relative to their scroll container when desired?

The default behavior could remain unchanged (fixed) to avoid breaking changes.

Happy to explore a PR if this aligns with the design goals.

Reproduction / Context

Video demonstrating the behavior: https://github.com/user-attachments/assets/9c51e528-6e4e-44c1-a933-107ad55570cf

KanhaiyaPandey avatar Feb 25 '26 08:02 KanhaiyaPandey

Hi! I'm ready to work on this. Could you assign it to me?

Ashwin906 avatar Feb 27 '26 05:02 Ashwin906

Hi

I checked the component flow: Select → SelectAria → Popover → Overlay (react-aria)

From what I observed, the dropdown behavior comes from Overlay, which portals the popover to document.body. Because of this, the dropdown does not scroll with its container.

I’d like to work on this by implementing positioning strategy in Popover' (e.g., fixedvsabsolute) so components like Select` can render relative to their scroll container when needed.

If this approach is good enough for this issue , could this issue be assigned to me?

kumar-avinash-sharma avatar Mar 10 '26 09:03 kumar-avinash-sharma