Loss of reactivity in UITable
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 }"
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
/>
I just started experiencing this as well. Setting :key="..." on UTable fixes the issue for now.
Same issue here, only setting a key solves it for now.
Having the same here... In my case, setting a key doesn't work...
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: