Skip to content

bug(cdk-menu): cdkMenu is not positioned correctly if mat.core() is not added #26856

Open
@GeorgianStan

Description

@GeorgianStan

Description

I'm trying to use the Angular CDK. From my understanding Angular CDK should be completly independent as it states here:

The Component Dev Kit (CDK) is a set of behavior primitives for building UI components

The problem is not the cdkMenu is not displayed correctly if mat.core() from Angular Material is not included.

Reproduction

StackBlitz

Steps to reproduce:

  1. Click on Click me button (the menu is displayed correctly below the button).
  2. Comment @include mat.core(); from styles.scss.
  3. Click on Click me button.

Expected Behavior

The menu should be displayed in the same way, under the component.

Actual Behavior

It is displayed in the left edge.

Environment

  • Angular: 15
  • CDK/Material: 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: cdk/menudocsThis issue is related to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions