Skip to content

MdMenu, OverlayRef: Cannot read property 'removeChild' of null #1812

@rolandjitsu

Description

@rolandjitsu

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Should not throw an exception.

What is the current behavior?

The first time a user navigates away (clicks on one of the items in the menu that leads to another page - via angular router) from a <md-menu> that is currently opened, it throws an exception:

TypeError: Cannot read property 'removeChild' of null
    at HTMLDivElement.eval (overlay-ref.js:86)
    at e.invokeTask (zone.min.js:1)
    at Object.onInvokeTask (core.umd.js:6197)
    at e.invokeTask (zone.min.js:1)
    at n.runTask (zone.min.js:1)
    at HTMLDivElement.invoke (zone.min.js:1)
ErrorHandler.handleError @ core.umd.js:3010
next @ core.umd.js:6654
schedulerFn @ core.umd.js:5952
SafeSubscriber.__tryOrUnsub @ Subscriber.ts:238
SafeSubscriber.next @ Subscriber.ts:190
Subscriber._next @ Subscriber.ts:135
Subscriber.next @ Subscriber.ts:95
Subject.next @ Subject.ts:61
EventEmitter.emit @ core.umd.js:5944
NgZone.triggerError @ core.umd.js:6248
onHandleError @ core.umd.js:6227
n.runTask @ zone.min.js:1
invoke @ zone.min.js:1

What are the steps to reproduce?

Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: http://plnkr.co/edit/o077B6uEiiIgkC0S06dd

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

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

2.0.0-alpha.10

Is there anything else we should know?

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