You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Dropdown] : Dropdown menu renders already scrolled when max-height is applied #56144
Position the dropdown at top of viewport. Open it. Dropdown menu will render, is scrollable and is not automatically scrolled.
Then close it. Then position the dropdown at the bottom of viewport. Then open the dropdown. The menu will open already scrolled close to the bottom.
What is expected?
I expect the dropdown to always open with the menu not already scrolled.
What is actually happening?
The menu is opening already scrolled depending on where the dropdown is relative to the viewport. This specifically occurs when autoFocus = {true} and autoAdjustOverflow={false}.
Environment
Info
antd
6.1.0
React
19.2.1
System
Windows 10
Browser
Chrome: Version 143.0.7499.41 (Official Build) (64-bit)
While not particularly egregious for standard dropdowns, it can create a really bad UX for keyboard users who open a submenu using the arrow key. (shown in video)
Hello @John-Feola, We need you to provide an online reproduction example to help us investigate the issue. You can either fork this online reproduction template or create a minimal project repository using our Scaffolding Guide. This issue will be automatically closed if no follow-up is made within 3 days.
I traced the behavior to the autoFocus path in @rc-component/dropdown: it focuses the first menu item without preventScroll, so the browser may scroll a max-height menu when the popup is placed near the bottom of the viewport with autoAdjustOverflow={false}.
I'll prepare an upstream fix with a regression test and follow up here with the PR link.
The patch keeps autoFocus but focuses the menu with { preventScroll: true }, preventing a max-height dropdown from opening at a shifted scroll position. It also adds a regression assertion and preserves the existing Tab-key focus path.
Activity
coderabbitai commentedon Dec 9, 2025
📝 CodeRabbit Plan Mode
Generate an implementation plan and agent prompts for this issue.
Examples
🔗 Similar Issues
Related Issues
👤 Suggested Assignees
🧪 Issue enrichment is currently in early access.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:MadCcc commentedon Dec 10, 2025
Your repoduction is private, we can't see it.
github-actions commentedon Dec 10, 2025
Hello @John-Feola, We need you to provide an online reproduction example to help us investigate the issue. You can either fork this online reproduction template or create a minimal project repository using our Scaffolding Guide. This issue will be automatically closed if no follow-up is made within 3 days.
你好 @John-Feola,我们需要你提供一个在线的重现示例以便于我们帮你排查问题。你可以通过 fork 这个在线重现模板,或者基于我们的脚手架指南 新建一个最小化项目仓库。3 天内未跟进此 issue 将会被自动关闭。
John-Feola commentedon Dec 10, 2025
It should be accessible now, sorry about that
lkxdsb commentedon Sep 2, 2026
I'd like to work on this issue.
I traced the behavior to the
autoFocuspath in@rc-component/dropdown: it focuses the first menu item withoutpreventScroll, so the browser may scroll a max-height menu when the popup is placed near the bottom of the viewport withautoAdjustOverflow={false}.I'll prepare an upstream fix with a regression test and follow up here with the PR link.
lkxdsb commentedon Sep 17, 2026
Upstream fix PR: react-component/dropdown#271
The patch keeps
autoFocusbut focuses the menu with{ preventScroll: true }, preventing a max-height dropdown from opening at a shifted scroll position. It also adds a regression assertion and preserves the existing Tab-key focus path.