angular / angular/components

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

Abierto
#30,862 0 comentarios 3 reacciones 0 asignados Ver en GitHub
area: cdk/menu feature P4
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

### 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](https://github.com/angular/components/issues/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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la descripción general del menú de Angular CDK y el ejemplo de StackBlitz para reproducir el comportamiento actual del tamaño; issue 26336 proporciona contexto relacionado sobre la configuración del ancho del menú. Se considera completado cuando el menú puede adoptar el ancho del contenedor del trigger sin requerir un ancho fijo en píxeles, con el comportamiento demostrado en un ejemplo o prueba apropiados.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.