Side Nav - fullscreen should make the side nav full screen only when its open
- Lingua principale
- TypeScript
- Stelle
- 25k
- Fork
- 6.8k
- Merge medio
- 1g 8h
- PR unite (30g)
- 91
Descrizione
#### 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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con l’API fullscreen di mat-sidenav-container e riproduci l’interazione segnalata con ngx-infinite-scroll, usando come contesto gli esempi e i report collegati. Il lavoro è completato quando gli stili fullscreen vengono applicati al container mentre la side nav è aperta, senza impedire gli eventi di scorrimento della pagina quando è chiusa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100