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

[Bug Report][3.4.4] VDataTableVirtual renders all rows when items are updated #18806

Open
ttonyh opened this issue Dec 1, 2023 · 8 comments
Open
Assignees
Labels
C: VDataTableVirtual C: VVirtualScroll P: high The issue is of high importance T: bug Functionality that does not work as intended/expected

Comments

@ttonyh
Copy link

ttonyh commented Dec 1, 2023

Environment

Vuetify Version: 3.4.4
Last working version: 3.3.23
Vue Version: 3.3.9
Browsers: Firefox 119.0, Google Chrome
OS: Linux x86_64

Steps to reproduce

  1. Create a ref with empty array
  2. Assign it to VDataTableVirtual's :items prop
  3. Create a setTimeout and update the ref variable in step 1 with a large number of items
  4. Inspect the DOM of the .v-table tbody and count the rows or use the following: document.querySelector('.v-table tbody').querySelectorAll('tr').length in the console

NOTE: This seems to have broken AFTER 3.4.0

Expected Behavior

Only visible rows should render at once.

Actual Behavior

All rows render.

Reproduction Link

UPDATED: https://play.vuetifyjs.com/#...

OLD: https://play.vuetifyjs.com/#...

@shengzhou1216
Copy link

+1

@ttonyh
Copy link
Author

ttonyh commented Dec 6, 2023

This looks like it may have been resolved in v3.4.5. @shengzhou1216 Can you please confirm?

@shengzhou1216
Copy link

This looks like it may have been resolved in v3.4.5. @shengzhou1216 Can you please confirm?

I have tested the issuse in v3.4.5 and v3.4.6, it seems that the problem still persists.

@ttonyh
Copy link
Author

ttonyh commented Dec 8, 2023

@shengzhou1216 I saw your commit and tried to add the following prop to the VDataTableVirtual, and it had the same effect:

<v-data-table-virtual :item-height="16"></v-data-table-virtual>

Updated Playground Link

@ttonyh
Copy link
Author

ttonyh commented Dec 14, 2023

Temporary workaround posted above seems to work intermittently.

@nanjarapalli
Copy link

+1 Waiting for official fix
@ttonyh Thanks temporary solution worked

@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VDataTableVirtual and removed S: triage labels Dec 18, 2023
@johnleider johnleider added this to the v3.4.x milestone Dec 18, 2023
@tilenpirih
Copy link
Contributor

tilenpirih commented Jan 11, 2024

one temporary solution that worked for me is to rerender v-data-table-virtual when items are updated by using :key property. Every time length changes it rerenders the component.

<template>
  <v-data-table-virtual
    :headers="headers"
    :items="boats"
    height="400"
    item-value="name"
    :key="boats.length"
  ></v-data-table-virtual>
</template>```

@johnleider johnleider removed this from the v3.4.x milestone Jan 22, 2024
@IceflowRE
Copy link

Same issue for VirtualScroll

https://play.vuetifyjs.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDataTableVirtual C: VVirtualScroll P: high The issue is of high importance T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants