Skip to content

[ContextMenu] Auto-add menu to closest shadow root instead of the body #8809

@web-padawan

Description

@web-padawan

Describe your motivation

Currently, ContextMenu uses OverlayAutoAddController to add itself to the body, see #7792.

This might be a problem for embedded apps, e.g. in docs Flow examples CSS is not applied correctly:

Image

Describe the solution you'd like

Consider using the same approach as Popover to add ContextMenu next to its target, or closest shadow root.
This is potentially a behavior altering change, so maybe there could be an API to make this configurable.

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