Akryum / vue-virtual-scroller

⚡️ Blazing fast scrolling for any amount of data
https://vue-virtual-scroller-demo.netlify.app
9.27k stars 885 forks source link

Dynamic scroller not handling `items` prop changes correctly #774

Closed wsdimitri closed 1 year ago

wsdimitri commented 1 year ago

Describe the bug

Using the demo project (cloned, on the latest beta version), when filtering the dynamic scroller, previous elements are shown and overlap other items. See screenshot below:

image

This is using the latest beta version 2.0.0-beta.5. The issue is also present on 2.0.0-beta.4 but not 2.0.0-beta.3.

It seems a recent change in beta 4 broke this functionality.

Reproduction

Clone the demo project and ensure vue-virtual-scroller is on the latest version.

Or, here's a StackBlitz: https://stackblitz.com/edit/vue-8g2g2k. You might have to try filtering a few times because there's 1/10th of total items due to stackblitz restrictions.

System Info

npmPackages:
    @vitejs/plugin-vue: ^3.1.2 => 3.2.0 
    vite: ^3.1.8 => 3.2.5 
    vue: ^3.2.41 => 3.2.45 
    vue-virtual-scroller: 2.0.0-beta.5 => 2.0.0-beta.5

Used Package Manager

npm

Validations

cotillion commented 1 year ago

We're also seeing this. Revert to beta.3 fixed it. It seems the views are marked as nr.used = false but are still rendered.