components icon indicating copy to clipboard operation
components copied to clipboard

Feature request: Add content to Sidenav Backdrop

Open sasxa opened this issue 9 years ago • 6 comments

Bug, feature request, or proposal:

feature request: Ability to add content to sidenav backdrop.

What is the expected behavior?

https://github.com/angular/material2/blob/master/src/lib/sidenav/sidenav-container.html

Perhaps add another <ng-content>:

<div class="mat-sidenav-backdrop" (click)="_onBackdropClicked()"
     [class.mat-sidenav-shown]="_isShowingBackdrop()">

     <ng-content select="md-sidenav-backdrop, mat-sidenav-backdrop"></ng-content>

</div>

<ng-content select="md-sidenav, mat-sidenav"></ng-content>

<div class="mat-sidenav-content" [ngStyle]="_getStyles()" cdk-scrollable>
  <ng-content></ng-content>
</div>

What is the current behavior?

Not supported.

What is the use-case or motivation for changing an existing behavior?

At the moment backdrop is blank, but it would be nice if we could insert some content there...

sasxa avatar Mar 04 '17 02:03 sasxa

What kind of content would you want to add inside of a backdrop?

crisbeto avatar Mar 04 '17 09:03 crisbeto

Anything really (any component). Let's say sidenav has a list of items and on hover over each of them I want to play a video, or show description with images in the backdrop on large screens...

sasxa avatar Mar 04 '17 09:03 sasxa

This doesn't sound like the sidenav should handle. The backdrop is meant to be static and only be there to catch clicks. The way it's set up at the moment is that it doesn't even get processed by Angular. Thoughts @mmalerba?

crisbeto avatar Mar 04 '17 10:03 crisbeto

Take a look at the editor at https://sway.com/. This type of interface would be easy to create with sidenav, something like this:

<md-sidenav-container>
  <md-sidenav>
    <md-sidenav-container>
      <md-sidenav>
        <CARDS_COMPONENT></CARDS_COMPONENT>
        <!-- sidenav content -->
      </md-sidenav>

      <STORYLINE_COMPONENT></STORYLINE_COMPONENT>
      <!-- primary content -->
    </md-sidenav-container>
  </md-sidenav>

  <md-sidenav-backdrop>
    <PREVIEW_COMPONENT></PREVIEW_COMPONENT>
  </md-sidenav-backdrop>

</md-sidenav-container>

sasxa avatar Mar 04 '17 10:03 sasxa

This isn't something we plan on adding; we consider the backdrop to primarily be an indicator that the content is inactive. Adding additional content would be trying to add too much behavior to this.

jelbourn avatar May 01 '17 23:05 jelbourn

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.