-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
CDK Virtual Scroll ViewDestroyed Error #13901
Comments
The stack traces lead to |
Same problem here, 😢 |
… the template cache Currently when detaching a view, we check whether it would fit in the cache, and if it doesn't, we destroy it. Since we destroy the view on it's own, the `ViewContainerRef` still has a reference to it, which means that we'll trigger change detection on it the next time the data changes. These changes switch to destroying the view through the view container. Fixes angular#13901.
… the template cache Currently when detaching a view, we check whether it would fit in the cache, and if it doesn't, we destroy it. Since we destroy the view on it's own, the `ViewContainerRef` still has a reference to it, which means that we'll trigger change detection on it the next time the data changes. These changes switch to destroying the view through the view container. Fixes angular#13901.
… the template cache (#13916) Currently when detaching a view, we check whether it would fit in the cache, and if it doesn't, we destroy it. Since we destroy the view on it's own, the `ViewContainerRef` still has a reference to it, which means that we'll trigger change detection on it the next time the data changes. These changes switch to destroying the view through the view container. Fixes #13901.
… the template cache (angular#13916) Currently when detaching a view, we check whether it would fit in the cache, and if it doesn't, we destroy it. Since we destroy the view on it's own, the `ViewContainerRef` still has a reference to it, which means that we'll trigger change detection on it the next time the data changes. These changes switch to destroying the view through the view container. Fixes angular#13901.
… the template cache (#13916) Currently when detaching a view, we check whether it would fit in the cache, and if it doesn't, we destroy it. Since we destroy the view on it's own, the `ViewContainerRef` still has a reference to it, which means that we'll trigger change detection on it the next time the data changes. These changes switch to destroying the view through the view container. Fixes #13901.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Scrolling of virtual-scroll list is possible during an updating process of the data without any errors.
What is the current behavior?
When a virtual scroll list of items is during an update process of the items, scrolling the list causes an "Attempt to use a destroyed view" error. In realworld use case an array of objects are being updated (property changes in the objects). In the stackblitz demo a setInterval updates the data. I suspect the error is caused through reassignment of the data during scrolling.
What are the steps to reproduce?
StackBlitz starter: https://stackblitz.com/edit/angular-cwrtae
Open console, press button to start updating the data and then scroll back and forth continuously.
What is the use-case or motivation for changing an existing behavior?
The virtual-scroll directive should be possible to use with a list of data that is being in an updating/changing process.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
7.0.0
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: