Skip to content

Need to use rootOverlay for positioning MenuAnchor #161437

@lukas-pierce

Description

@lukas-pierce

After merging #155539

Since OverlayPortal.targetsRootOverlay is now used, the root Overlay must be used when calculating the position for _Submenu

final RenderBox overlay = Overlay.of(
  anchorContext, 
  rootOverlay: true // NEED ADD THIS
).context.findRenderObject()! as RenderBox;

Line to need fixed

final RenderBox overlay = Overlay.of(anchorContext).context.findRenderObject()! as RenderBox;

How to fix
add rootOverlay: true

How to reproduce the problem
Create a nested navigator with a height less than the screen height and put DropdownMenu there

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: material designflutter/packages/flutter/material repository.found in release: 3.27Found to occur in 3.27found in release: 3.28Found to occur in 3.28frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions