vue-virtual-scroller icon indicating copy to clipboard operation
vue-virtual-scroller copied to clipboard

Bug introduced in v1.1.2, possible cause in description

Open Krisell opened this issue 2 years ago • 7 comments
trafficstars

Describe the bug

After updating to v1.1.2 we started seeing some strange issues in lists using DynamicScroller. Data seems to be reused from other rows. Downgrading to v1.1.1 resolved the issue. Looking at the diff between these two versions, we noticed a highly suspicious code change.

image

view.item is an object in our case, and keyField defines how to compare this with existing elements. Direct strict object equality doesn't work even if the objects would have the same contents.

Are we using the library wrong, or is this an unintended change?

Manually reverting this line resolves the problem (with the rest of the code from v1.1.2).

Reproduction

The current issue is deep within our application, and I'm hoping the description above is clear enough. If it is not, I will try to reproduce with something smaller.

System Info

System:
    OS: macOS 13.0.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 101.58 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 19.3.0 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 9.1.1 - ~/node_modules/.bin/npm
  Browsers:
    Chrome: 108.0.5359.124
    Chrome Canary: 111.0.5486.0
    Firefox: 106.0.2
    Safari: 16.1
  npmPackages:
    vue: ^2.6.14 => 2.6.14
    vue-virtual-scroller: ^1.1.2 => 1.1.2

Used Package Manager

npm

Validations

Krisell avatar Dec 19 '22 14:12 Krisell

I'm not familiar with the source code but for version 2.x this probably got fixed by: https://github.com/Akryum/vue-virtual-scroller/commit/395bbfb73588455795ecc5b144281ce5fda042ff. I'm not sure if there is a reason why this is not implemented for version 1.x yet or if it is even compatible.

Vissie2 avatar Dec 21 '22 20:12 Vissie2

I am having the same issue

Oleksii14 avatar Dec 26 '22 09:12 Oleksii14

@Akryum this is critical, could push a fix for Vue 2?

Oleksii14 avatar Dec 27 '22 07:12 Oleksii14

@Akryum this is critical, could push a fix for Vue 2?

You can lock to 1.1.1 while awaiting a fix.

Krisell avatar Dec 27 '22 11:12 Krisell

Hey. I can confirm this issue. Had some similiar problems with rows, that are collapsable. This did not work with 1.1.2, because a height from another row was taken, so I could expand them, but minimizing again failed. Using 1.1.1 solved the issue.

beatgrabe avatar Feb 13 '23 15:02 beatgrabe

I created a reproduction sample:

https://codesandbox.io/s/charming-carson-3cy5c4

When you clicked on the "Toggle" Button, the row may get minimized but leaving a white gap below. With 1.1.1 this does not happen.

beatgrabe avatar Feb 14 '23 07:02 beatgrabe

1.1.1 is broken, DynamicScroller crashed in this version https://github.com/Akryum/vue-virtual-scroller/issues/758

leonied7 avatar Apr 26 '23 11:04 leonied7