Skip to content

Strange behavior when table has no rows #495

@ml1nk

Description

@ml1nk

mantine-react-table version

v2.0.0-beta.9

react & react-dom versions

v19

Describe the bug and the steps to reproduce it

I think because of #445 the behavior of empty rows changed and lead to issues with renderDetailPanel and mantineTableBodyCellProps/onClick. Both now trigger if there are no rows, but naturally row.original is an empty object. This doesn't match the typing, because original is T from MRT_Row. It can be catched by the id field which is always "mrt-row-empty".

Additionally it shows a disabled Details button if you return undefined in renderDetailPanel on an empty row.
Image

From the original PR all these changes seem somewhat intended, but at least the typing is now incorrect and it would be nice to have a flag to get the old behavior back. What do you think?

Minimal, Reproducible Example - (Optional, but Recommended)

https://v2.mantine-react-table.com/docs/guides/detail-panel#enable-detail-panel-demo

Image

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms

  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    V2Issue with MRT V2bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions