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

Table rows all fall on "even" when renderDetailPanel is enabled #245

Closed
1 task done
ryjogo opened this issue Dec 10, 2022 · 2 comments
Closed
1 task done

Table rows all fall on "even" when renderDetailPanel is enabled #245

ryjogo opened this issue Dec 10, 2022 · 2 comments

Comments

@ryjogo
Copy link

ryjogo commented Dec 10, 2022

material-react-table version

1.4.0

react & react-dom versions

17.0.1

Describe the bug and the steps to reproduce it

Looks like the table rows are all on "even" when renderDetailPanel is enabled, this causes the "striped" setup to fail.

Minimal, Reproducible Example - (Optional, but Recommended)

        muiTableBodyProps={{
          sx: (theme) => ({
            '& tr:nth-of-type(odd)': {
              backgroundColor: "limegreen",
            },
          }),
        }}

Screenshots or Videos (Optional)

No response

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

No, because I don't know how

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.
@KevinVandy
Copy link
Owner

Yeah, that's just how the detail panel works. Nothing wrong with the lib. Try just styling every other odd row instead?

Try '& tr:nth-child(4n+1) or '& tr:nth-child(4n+3) instead

www.material-react-table.dev/?path=/story/styling-style-table-body-rows--style-custom-striped-rows-detail-panel

@ryjogo
Copy link
Author

ryjogo commented Dec 10, 2022

Yeah fair enough; i wasn't sure whether to open a bug or not - but now i did it :). thanks anyway, yes this is totally fine with a css fix! thank you.

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

2 participants