Skip to content

Md-Sidenav open mode bootstrap animation #6865

Closed

Description

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When using universal, the sidenav (in side mode) will be rendered already open in the initial page load, and then when the app bootstraps, it will stay open.

What is the current behavior?

The initial pre-rendered page loads with the sidenav closed, and then when the app boostraps, the sidenav animates open.

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

In beta 8, it worked perfectly. The initial pre-rendered html file aligned with the bootstrap re-render.
Now, the page loads with the sidenav closed, and after a number of seconds later (when the app bootstraps) the sidenav suddenly animates open, which is quite distracting.

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

Angular 4.3.3, material 2.0.0-beta8, windows 10

Activity

  1. CaerusKaru commented on Sep 30, 2017

    @CaerusKaru
    Member

    The problem here is actually deeper than anticipated. See here:

    https://github.com/angular/material2/blob/20a23f16e8ac1ced29172709cc837fa500b6377b/src/lib/sidenav/drawer.ts#L347-L350

    https://github.com/angular/material2/blob/20a23f16e8ac1ced29172709cc837fa500b6377b/src/lib/sidenav/drawer.ts#L553-L585

    Since the margins for the mat-drawer-content depend on elements that haven't been rendered yet, Universal can't possibly predict the width, leaving it static at 0, and populated on bootstrap on the client. The "animation" is really just the transition CSS firing once the width is populated. At least that's my theory, it all depends on how Angular (and Universal) constructs the application in order (since I think Universal just gives it one go)

    @mmalerba Is there a possible refactoring we can do here, maybe by searching the element tree for CSS width if none other is available?

  2. CaerusKaru commented on Oct 15, 2017

    @CaerusKaru
    Member

    As documented in #7795, there's also an issue with transform: translate3d(0,0,0) not being applied correctly.

  3. CaerusKaru commented on Oct 15, 2017

    @CaerusKaru
    Member

    There's also currently an issue open angular/angular#19235 that is tracking an issue with style.property not being applied correctly if the property name is in camelCase (in drawer, this is marginRight and marginLeft).

  4. added
    P3
    regression
    on Nov 21, 2017
  5. added this to the 5.0 milestone on Nov 21, 2017
  6. mmalerba commented on Nov 28, 2017

    @mmalerba
    Contributor

    should be fixed by #8488

  7. CaerusKaru commented on Dec 5, 2017

    @CaerusKaru
    Member

    @mmalerba Issue not resolved by #8488

  8. self-assigned this
    on Dec 5, 2017
  9. added 2 commits that reference this issue on Dec 5, 2017
    d159ad0
    cb411d3
  10. added a commit that references this issue on Dec 5, 2017
    2b1f84e
  11. CaerusKaru commented on Dec 6, 2017

    @CaerusKaru
    Member

    @crisbeto Still not fixed

  12. algcifaldi commented on Jan 8, 2018

    @algcifaldi

    As far as I can tell, this is still happening in the latest release. Is #8969 the new issue to track for status updates?

  13. agustinhaller commented on Mar 13, 2018

    @agustinhaller

    Hi, any updates on this? In my case it was working OK with Angular 5.0.2 and material 5.0.0.rc0 but stop working when updated to Angular 5.2.8 and material 5.2.4

  14. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  15. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P3regression

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions