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

VirtualScroll: Attempt to use a destroyed view #14004

Closed
ln-e opened this issue Nov 6, 2018 · 2 comments
Closed

VirtualScroll: Attempt to use a destroyed view #14004

ln-e opened this issue Nov 6, 2018 · 2 comments

Comments

@ln-e
Copy link

ln-e commented Nov 6, 2018

Bug, feature request, or proposal:

There is a bug in virtual scroll. When I scroll a little bit I see a lot of errors in console

ERROR Error: ViewDestroyedError: Attempt to use a destroyed view: detectChanges
    at viewDestroyedError (core.js:7606)
    at Object.debugUpdateDirectives [as updateDirectives] (core.js:11051)
    at checkAndUpdateView (core.js:10451)
    at callWithDebugContext (core.js:11344)
    at Object.debugCheckAndUpdateView [as checkAndUpdateView] (core.js:11022)
    at ViewRef_.push../node_modules/@angular/core/fesm5/core.js.ViewRef_.detectChanges (core.js:8838)
    at CdkVirtualForOf.push../node_modules/@angular/cdk/esm5/scrolling.es5.js.CdkVirtualForOf._updateContext (scrolling.es5.js:1729)
    at CdkVirtualForOf.push../node_modules/@angular/cdk/esm5/scrolling.es5.js.CdkVirtualForOf.ngDoCheck (scrolling.es5.js:1648)
    at checkAndUpdateDirectiveInline (core.js:9246)
    at checkAndUpdateNodeInline (core.js:10507)

In my understanding function _cacheView (https://github.com/angular/material2/blob/master/src/cdk/scrolling/virtual-for-of.ts#L323) destroy view, but do not remove it from _viewContainerRef so _updateContext try to work with destroyed view.

What is the expected behavior?

There should not be any errors.

What is the current behavior?

What are the steps to reproduce?

https://angular-xd2wda.stackblitz.io

error

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

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

angular 7.0.2
cdk 7.0.2

Is there anything else we should know?

@crisbeto
Copy link
Member

crisbeto commented Nov 6, 2018

Will be fixed by #13916 in the next release.

@crisbeto crisbeto closed this as completed Nov 6, 2018
@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 10, 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

2 participants