Skip to content

[Bug] MdlSelectComponent. Error after view destroy #1801

Open
@SridharSudharshan

Description

@SridharSudharshan

This seems to be the same as in this issue

Console log

Error: ViewDestroyedError: Attempt to use a destroyed view: detectChanges
    at viewDestroyedError (core.js:28817)
    at Object.debugUpdateDirectives [as updateDirectives] (core.js:45255)
    at checkAndUpdateView (core.js:44270)
    at callWithDebugContext (core.js:45631)
    at Object.debugCheckAndUpdateView [as checkAndUpdateView] (core.js:45193)
    at ViewRef_.detectChanges (core.js:31125)
    at MdlSelectComponent.renderValue (angular-mdl-select.js:680)
    at MdlSelectComponent.writeValue (angular-mdl-select.js:440)

Steps to reproduce

  1. Apply structural directive to MdlElement or its container
  2. Match conditions to destroy/init view
  3. Match conditions to init/destroy view

The issue verified both on reactive and template-driven forms

I've also tried applying this fix and it seems to work. Could you please take a look at this?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions