angular / angular/components

Side Nav - fullscreen should make the side nav full screen only when its open

Abierto
#17,380 4 comentarios 2 reacciones 0 asignados Ver en GitHub
area: material/sidenav feature needs: discussion P3
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

#### Feature Description

The `fullscreen` api of `mat-sidenav-container` allow us to show the side nav with height set to 100% of the viewport. And this probably is the most followed way to achieve this as proposed by these answers on stack overflow:

https://stackoverflow.com/questions/37334853/cant-get-angular-material-md-sidenav-to-be-100-height
https://stackoverflow.com/questions/46666381/unable-to-set-the-height-of-a-angular-material-sidenav-to-100

`fullscreen` option sets the below css properties on `mat-sidenav-container`:

```
top: 0!important;
left: 0!important;
right: 0!important;
bottom: 0!important;
position: absolute!important;
```

As a side effect I believe this blocks the scroll events and as a result it breaks the functionality of components/directives that relies on scroll events. For example, `ngx-infinite-scroll` is one of the commonly used plugins (87k weekly downloads) that allow loading contents as soon as user reaches to the bottom of the page. When we set `fullscreen` on `mat-sidenav-container` , `ngx-infinite-scroll` no longer works. As reported here

https://stackoverflow.com/questions/50377502/angular-material-and-ngx-infinite-scroll?rq=1

and

https://github.com/orizens/ngx-infinite-scroll/issues/182

What if we apply the below styles of `fullscreen` mode **only** when the side nav is opened:

```
top: 0!important;
left: 0!important;
right: 0!important;
bottom: 0!important;
position: absolute!important;
```

This way it wont affect the other portion of the application. Because when the nav bar is open user wont be scrolling the page contents, so if the scroll events are blocked it wont be a issue.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la API fullscreen de mat-sidenav-container y reproduce la interacción reportada con ngx-infinite-scroll, usando como contexto los ejemplos y reportes enlazados. Se considera terminado cuando los estilos de fullscreen afectan al contenedor mientras la side nav está abierta, sin impedir los eventos de desplazamiento de la página cuando está cerrada.

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
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.