Skip to content
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

Problems with property opened in Angular Material --> sidenav #1370

Closed
ADominguezes opened this issue Sep 29, 2016 · 11 comments
Closed

Problems with property opened in Angular Material --> sidenav #1370

ADominguezes opened this issue Sep 29, 2016 · 11 comments
Assignees

Comments

@ADominguezes
Copy link

I've a problem with sidenav, with the property "opened" of md-sidenav

I've this code:

<md-sidenav #sidenav mode="side" class="app-sidenav" opened="true">
    ...
</md-sidenav>

When I refresh the page, sidenav is open and it's ok, but when I click in the button for close sidenav, I've the next errors in console:

error_handler.js:45 EXCEPTION: Uncaught (in promise): undefined
error_handler.js:50 ORIGINAL STACKTRACE:
error_handler.js:51 Error: Uncaught (in promise): undefined
at resolvePromise (zone.js:429)
at MdSidenav._openPromiseReject (zone.js:406)
at MdSidenav._onTransitionEnd (sidenav.js:152)
at DebugAppView._View_AppComponent0._handle_transitionend_5_0 (AppComponent.ngfactory.js:2129)
at view.js:404
at dom_renderer.js:249
at dom_events.js:26
at ZoneDelegate.invoke (zone.js:203)
at Object.onInvoke (ng_zone_impl.js:43)
at ZoneDelegate.invoke (zone.js:202)
zone.js:357 Error: Uncaught (in promise): undefined(…)

My version of Angular Material is: 2.0.0-alpha.9
My version of Sidenav is: 2.0.0-alpha.8-2

@paumayr
Copy link

paumayr commented Sep 29, 2016

As of 2.0.0-alpha.9 there is only a single package called @angular/material
you can uninstall all @angular2-material/* packages, as all controls are now in @angular/material.

Note: also, update your NgModule to only reference MaterialModule / MaterialModule.forRoot()

@ADominguezes
Copy link
Author

Ammm!! ok thank you I didn't know. ;)
The problem with sidenav continues.

@rolandjitsu
Copy link

Experiencing the same issue. Happens only once, the first time you trigger a change in state (open/close).

@ADominguezes
Copy link
Author

Yes it's true, the error shows only the first time

@tapas4java
Copy link

Experienced the same issue on material 9-3. Any resolution for this?

@da45
Copy link

da45 commented Oct 17, 2016

Hi Guys, I any news please, did someone solve this issue?

@omararturo
Copy link

omararturo commented Oct 28, 2016

Hi,
This is the temporal solution:

import { Component, OnInit, ViewChild } from '@angular/core';
import { MeteorComponent } from 'angular2-meteor';
import { MdSidenav } from '@angular/material';

import template from './app.component.html';

@Component({
    selector: 'app',
    template
})
export class AppComponent extends MeteorComponent implements OnInit {

    @ViewChild('sidenav') sidenav: MdSidenav;

    constructor(
    ) { 
        super();
    }

    ngOnInit(): void {
        this.sidenav._onTransitionEnd = function () {            
            this._openPromise = null;
            this._closePromise = null;
        }
    }
}

I hope it will be helpful to you.

@jelbourn
Copy link
Member

jelbourn commented Nov 4, 2016

@mmalerba can you confirm that this is fixed in master?

@mmalerba
Copy link
Contributor

mmalerba commented Nov 4, 2016

Yup, I can repro it in the plunker template but not in master, so seems like it's fixed.

@mmalerba mmalerba closed this as completed Nov 4, 2016
@leocaseiro
Copy link
Contributor

leocaseiro commented Nov 16, 2016

I confim the error still happening with @angular/material@2.0.0-alpha.10

The fix from @omararturo works temporary for me.

PS: I reported detail about this error here: #1382 (comment)

@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 5, 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

9 participants