bug(cdk/overlay): scroll blocking overlay persists when documentElement shrinks to the point it is not needed
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 91
Descripción
### Description
This came up for an app that had a button to launch a full screen dialog. When you click the button it essentially hides the main app and launches the dialog. However, at the time the dialog launches, the content is still showing so it calculates the height based on documentElement here (https://github.com/angular/components/blob/main/src/cdk/overlay/scroll/block-scroll-strategy.ts#L111) and determines the scroll blocking class is needed. The main content then disappears making the blocking class unnecessary, but it never updates after the initial calculation. This results in a disabled scrollbar being shown in the app.
As a workaround, apps in this situation should ensure that they remove content they want to hide & wait for that change to be rendered in the DOM before launching the dialog.
Guía de contribución
Línea de trabajo
Comienza en src/cdk/overlay/scroll/block-scroll-strategy.ts alrededor de la línea 111, donde se usa el tamaño de documentElement para decidir si es necesario bloquear el desplazamiento. Reproduce la secuencia abriendo un diálogo a pantalla completa mientras el contenido principal todavía está presente y, después, ocultando ese contenido. Se considera completado cuando ya no queda el estado de bloqueo innecesario y no se muestra la barra de desplazamiento deshabilitada.
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
- Bastante claro
- Aptitud para principiantes
- 45/100