Skip to content

[Bug] Table row memo misses removed properties — cells keep rendering deleted field values indefinitely #3595

Description

@arham766

Description

areRowPropsEqual in packages/core/src/Table/BaseTable.tsx compares row items by iterating Object.keys(nextItem):

const keys = Object.keys(nextItem);
for (const key of keys) {
  if (prevItem[key] !== nextItem[key]) return false;
}
return true;

A key present on prevItem but deleted from nextItem is never compared, so memo reports the rows equal and skips the re-render — the cell keeps showing the deleted field's old value until some other field of that row changes.

Reproduction (executed on main)

const cols = [{key: 'name', header: 'Name'}, {key: 'status', header: 'Status'}];
render(<Table data={[{id: '1', name: 'Alice', status: 'active'}]} columns={cols} idKey="id" />);
rerender(<Table data={[{id: '1', name: 'Alice'}]} columns={cols} idKey="id" />); // status deleted
// → the Status cell still renders "active"

Why it matters

Server responses and optimistic updates routinely clear a field by omitting it (error, assignee, badge). The table then displays stale data indefinitely with no error.

Suggested fix

Key-count check before the loop: if (Object.keys(prevItem).length !== keys.length) return false;. Happy to send the PR.

Astryx Version

main (73bcac9)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions