ui icon indicating copy to clipboard operation
ui copied to clipboard

Loss of reactivity in UITable

Open brycesteve opened this issue 2 months ago • 3 comments

Package

v4.x

Description

I have a page based on the pages from Nuxt UI Dashboard template. The data is pulled using useFetch()

I handle sorting/pagination etc server side. Since v4.1.0, the reactivity no longer works. In the dev tools, I can see the props update correctly, but the UITable 'rows' property doesn't update. On UITable I have options set for 'manualSorting', 'manualPaging' etc. The tanStack docs say this is required for server handled data. If I remove these settings, everything works fine, but as the docs say this is required, I'm trying to keep it in. I have worked around the issue by adding a key to UITable. Whenever my data updates, I update the random key, and the table reloads the data. Without the key, everything updates on the page (pagination etc.), just not the actual table rows. This worked fine in Nuxt UI v4.0.1, so obviously something has changed somewhere.

Can anyone please explain if I actually need manualSorting, manualPaging etc., and if I do, why they are now causing the table to not rerender since v4.1.0? If I don't need them, I'll just take them out. But, I'm assuming that TanStack have made a point of saying this for a reason. I'd appreciate any info anyone can provide.

For clarity, it seems to be these lines that are breaking the rendering:

:column-filters-options="{ manualFiltering: true}"
        :sorting-options="{ manualSorting: true }"
        :pagination-options="{ manualPagination: true }"

brycesteve avatar Oct 26 '25 23:10 brycesteve

Having the same issue, but the problem for me was using v-model:global-filter, removing it gets the reactivity back

 <UTable
    ref="table"
    v-model:global-filter="search" 
    :data="items"
    :columns
    :initial-state="{ pagination: { pageSize: limit } }"
    :loading
    sticky
 />

MuhammadM1998 avatar Oct 27 '25 16:10 MuhammadM1998

I just started experiencing this as well. Setting :key="..." on UTable fixes the issue for now.

spektral3 avatar Oct 29 '25 11:10 spektral3

Same issue here, only setting a key solves it for now.

patriktoth67 avatar Oct 31 '25 08:10 patriktoth67

Having the same here... In my case, setting a key doesn't work...

vircoding avatar Nov 20 '25 03:11 vircoding

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), they will be closed automatically after a while. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have templates to create a minimal reproduction:

  • Nuxt: https://codesandbox.io/p/devbox/nuxt-ui-xgrzw5
  • Vue: https://codesandbox.io/p/devbox/nuxt-ui-vue-f2qp34

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

github-actions[bot] avatar Nov 24 '25 13:11 github-actions[bot]