Skip to content

MatSidenavContainer / MatDrawerContainer size control #8240

Closed
@shlomiassaf

Description

@shlomiassaf

Bug, feature request, or proposal:

Bug

What is the expected behavior?

MatDrawerContainer should be able to act when the size nav changes and adjust the content element.

What is the current behavior?

MatDrawerContainer is OnPush so it will not update.

What are the steps to reproduce?

I don't have a quick use case but some scenarios are:

  • sidenav size is set after MatDrawerContainer init (later css, custom update etc..)
    this will freeze the content on the old width
  • Tri-state side-nav, this is a side nav with opened/closed state and a minimized state.
    When a move from open to minimize occurs UI will not update because the opened state did not change (i.e. its an virtual state)
    This is something like "icon mode" where the sidenav is slim with icons only.

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

Being able to notify the sidenav is important for custom behaviors and custom modes.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 5, material beta 12

Is there anything else we should know?

I see from the code that reacting to resizes is a problem because it leads to an expensive reflow, so a solution might be an API for the user to notify when a size recalc is needed.
(exposing _updateContentMargins())

Relates issues:
#7682 #8019

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions