UTable expand issue - row id alias necessary
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.9k
- Forks
- 1.1k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 57
Description
Package
v4.x
Description
Hello, I'm currently using a UTable with expandable rows, and it works great so far.
However, if I expand the first row and then remove the first item from the data source, the first row remains expanded.
How can I ensure that the expanded state stays linked to the correct item?
I was looking for something like a row-key or row-id to provide a stable unique identifier, but it seems UTable doesn’t offer this out of the box.
My current code looks like this
<UTable
:sorting="sorting"
:columns="columns"
:data="getData"
class="expandable"
:loading="isLoading"
:table-loader="isLoading"
@select="(event, row) => row.toggleExpanded()"
>
<template #expanded="{ row }">
expanded content
</template>
</UTable>
const getData = ref(
[
{title: 'one'},
{title: 'two'}
]
)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the UTable entry point and inspect how expandable-row state is associated with rows when the data array changes. Reproduce the case by expanding the first row, removing it from the data, and checking that the same item—not the new first row—remains expanded; done means a stable row identifier can preserve that association.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100