Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior when table has no rows #495

Open
1 task done
ml1nk opened this issue Feb 20, 2025 · 0 comments
Open
1 task done

Strange behavior when table has no rows #495

ml1nk opened this issue Feb 20, 2025 · 0 comments

Comments

@ml1nk
Copy link

ml1nk commented Feb 20, 2025

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant