Skip to content

[Dropdown] : Dropdown menu renders already scrolled when max-height is applied #56144

Open

Description

@John-Feola

Reproduction link

Edit on CodeSandbox

Steps to reproduce

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)

antDDropdownScrollableBug.mp4

Activity

  1. coderabbitai commented on Dec 9, 2025

    @coderabbitai
    Contributor

    📝 CodeRabbit Plan Mode

    Generate an implementation plan and agent prompts for this issue.

    • Create Plan
    Examples

    🔗 Similar Issues

    Related Issues

    👤 Suggested Assignees

    • prashilCeloxis
    • nidaacar

    🧪 Issue enrichment is currently in early access.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false
  2. MadCcc commented on Dec 10, 2025

    @MadCcc
    Member

    Your repoduction is private, we can't see it.

  3. github-actions commented on Dec 10, 2025

    @github-actions
    Contributor

    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 将会被自动关闭。

    什么是最小化重现,为什么这是必需的?

  4. John-Feola commented on Dec 10, 2025

    @John-Feola
    ContributorAuthor

    Your repoduction is private, we can't see it.

    It should be accessible now, sorry about that

  5. lkxdsb commented on Sep 2, 2026

    @lkxdsb
    Contributor

    I'd like to work on this issue.

    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.

  6. lkxdsb commented on Sep 17, 2026

    @lkxdsb
    Contributor

    Upstream fix PR: react-component/dropdown#271

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions