Skip to content

[DropdownMenu]: scroll jump issue #2331

@PavelZhuravlev

Description

@PavelZhuravlev

Bug report

Current Behavior

If the DropdownMenu is located within a parent container that has the transform property (regardless of the specific value), when the menu is opened, the scroll position jumps to the beginning of the page, and the menu remains off-screen.

Screen.Recording.2023-08-10.at.01.14.14.mov

Expected behavior

Regardless of the parent's properties, the menu should function correctly

Screen.Recording.2023-08-10.at.01.23.20.mov

Reproducible example

Demo

Additional context

The issue persists even with modal={true}, which should prevent scrolling. The scroll still jumps to the beginning of the page and then becomes locked.

<DropdownMenu.Portal/> hides the issue, but I don't think it's appropriate to consider this as a solution. I believe the menu should function correctly even without a portal.

relates to: #1688

Your environment

Software Name(s) Version
Radix Package(s) "@radix-ui/react-dropdown-menu": "^2.0.5",
React n/a
Browser
Assistive tech
Node n/a
npm/yarn
Operating System

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions