Skip to content

feat(Menu): Option to have it the same width as the trigger #30862

Open
@RVledder

Description

@RVledder

Feature Description

A possibility to have the https://material.angular.io/cdk/menu/overview take over the width of the container that triggers it.
As an example the grey area should span the full width of the red in the following example:

Image

Currently it seems that you have to provide a fixed width in px. Otherwise it does not work. But you don't always know the exact with of the 'trigger'.

There's an example here: https://vbqdncww.stackblitz.io

In issue 26336 it seems that they are overriding MAT_SELECT_CONFIG to set a min-width: min-content;, but have not gotten that to work yet.

Use Case

It would enable a more consistent styling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: cdk/menufeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions