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

Selected row style not set #386

Open
1 task done
maxehrhardt opened this issue Aug 9, 2024 · 2 comments
Open
1 task done

Selected row style not set #386

maxehrhardt opened this issue Aug 9, 2024 · 2 comments
Labels
bug Something isn't working V2 Issue with MRT V2

Comments

@maxehrhardt
Copy link

mantine-react-table version

V2

react & react-dom versions

18.3.0

Describe the bug and the steps to reproduce it

MantineTableBodyRow styling of selected row is not set as expected.
In V1 the styling of the selected row was set automatically:
https://www.mantine-react-table.com/docs/guides/row-selection

Which is not working in V2 anymore:
https://v2.mantine-react-table.com/docs/guides/row-selection

Minimal, Reproducible Example - (Optional, but Recommended)

V1 example:
https://www.mantine-react-table.com/docs/guides/row-selection

V2 example:
https://v2.mantine-react-table.com/docs/guides/row-selection

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.
@alessandrojcm alessandrojcm added bug Something isn't working V2 Issue with MRT V2 labels Nov 4, 2024
@alessandrojcm
Copy link
Collaborator

Hi, please confirm this still happens with the latest beta

@desytech
Copy link

desytech commented Nov 5, 2024

Hi, can confirm --mrt-selected-row-background-color does not work with the lastest beta.

Actual

  • var(--mantine-color-body) is used for background-color

Expected e.g.

  • var(--mrt-selected-row-background-color, --mantine-color-body)

Workaround for 2.0.0-beta.7

  1. Use CSS Modules
  2. Use Row Props
                mantineTableBodyRowProps={({ row }) => ({
                    onClick: row.getToggleSelectedHandler(),
                    style: {
                        cursor: "pointer",
                        backgroundColor: row.getIsSelected() ? "var(--mantine-color-gray-2)" : "inherit"
                    }
                })}

desytech added a commit to desytech/mantine-react-table that referenced this issue Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working V2 Issue with MRT V2
Projects
None yet
Development

No branches or pull requests

3 participants