angular / angular/components

m3 Issue with Dialog Width Property

Abierto
#28,604 2 comentarios 3 reacciones 0 asignados Ver en GitHub
area: material/dialog P4
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

When attempting to set the width property of a dialog element, it does not behave as expected. Specifically, using a fixed width or setting it to 100% results in unexpected behavior. When setting the width to 100%, the dialog is pushed to the left instead of occupying the entire viewport width. This inconsistency in behavior hampers the intended layout and user experience. Further investigation is required to identify the root cause and implement a suitable solution.

### Reproduction

StackBlitz link:
Steps to reproduce:
1. https://ng-comp-devapp.web.app/dialog

### Expected Behavior

1. When setting the width of the dialog element using a fixed value (e.g., pixels), the dialog should render with the specified width without any distortion or unexpected positioning.
2. When setting the width of the dialog element to 100%, it should occupy the entire width of the viewport, ensuring that it is centered horizontally and does not get pushed to the left or right edges of the screen.
3. The dialog should maintain responsiveness, adjusting its width dynamically based on the viewport size while adhering to the specified width constraints.

### Actual Behavior

1. When setting the width of the dialog element using a fixed value, the dialog may render with the specified width, but it might not align properly within the viewport or may not respect the specified width, leading to unexpected layout issues.
2. When setting the width of the dialog element to 100%, it may not occupy the entire width of the viewport as intended. Instead, it might get pushed to the left side of the screen, causing it to appear off-center or misaligned.
3. The responsiveness of the dialog may be compromised, with the width not adjusting appropriately based on the viewport size, leading to inconsistent presentation across different devices or screen sizes.

### Environment

- Angular: 17.2
- CDK/Material: 17.2
- Browser(s): Chrinr
- Operating System (e.g. Windows, macOS, Ubuntu): macos

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la reproducción del diálogo en https://ng-comp-devapp.web.app/dialog e inspecciona cómo se aplican los anchos fijos y width: 100%. Compara el posicionamiento y la capacidad de respuesta renderizados con el comportamiento centrado esperado; se considera completado cuando tanto los diálogos de ancho fijo como los de ancho completo se renderizan sin distorsión ni desalineación horizontal.

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
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.