angular2-mdl icon indicating copy to clipboard operation
angular2-mdl copied to clipboard

[Bug] MdlSelectComponent. Error after view destroy

Open SridharSudharshan opened this issue 5 years ago • 1 comments

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.

SridharSudharshan avatar Sep 27 '19 04:09 SridharSudharshan

I have opened a stackoverflow question for the same.

SridharSudharshan avatar Sep 27 '19 04:09 SridharSudharshan