angular / angular/components

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

Offen
#17,380 4 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/sidenav feature needs: discussion P3
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

#### 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der mat-sidenav-container fullscreen API und reproduziere die gemeldete Interaktion mit ngx-infinite-scroll unter Verwendung der verlinkten Beispiele und Berichte als Kontext. Als erledigt gilt die Aufgabe, wenn die Fullscreen-Stile auf den Container angewendet werden, während die Side Nav geöffnet ist, ohne Seiten-Scroll-Ereignisse zu verhindern, wenn sie geschlossen ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.