Skip to content

MatSidenavContainer / MatDrawerContainer size control #8240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shlomiassaf opened this issue Nov 6, 2017 · 4 comments
Closed

MatSidenavContainer / MatDrawerContainer size control #8240

shlomiassaf opened this issue Nov 6, 2017 · 4 comments

Comments

@shlomiassaf
Copy link
Contributor

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

@shlomiassaf
Copy link
Contributor Author

shlomiassaf commented Nov 6, 2017

Full Width - Opened

image

Minimized - Opened

image

Here it's clear the the click did update the sidenav but not the content.

Over mode - Closed

image

Before the update to this component, the whole page responded to resize through ngrx and if you minimized the browser it went from full -> minimized -> over mode

@axtho
Copy link

axtho commented Nov 7, 2017

this has already been in debate over here: #6743

@ramakanthreddyk
Copy link

Why does this not work with internet explorer?

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants