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

[Bug] DataTable with radio selection breaks when there are 2+ radio DataTables in DOM #16843

Closed
2 tasks done
FFahrenheit opened this issue Jun 21, 2024 · 2 comments · Fixed by #17015
Closed
2 tasks done
Assignees
Labels

Comments

@FFahrenheit
Copy link

FFahrenheit commented Jun 21, 2024

Package

@carbon/react

Browser

Chrome, Safari, Firefox

Package version

v1.60.0

React version

v18.2.0

Description

The DataTable radio selection breaks if there are two or more <DataTable> with radio selection property enabled.
The selection does not work in any of the two tables, selecting random rows between the tables in DOM

Reproduction/example

https://stackblitz.com/edit/github-rjvrvh?file=package.json

Steps to reproduce

  1. Add two (or more) <DataTable> with radio option. Happens even with different data and IDs
  2. Select a row in the first table
  3. Select a row in other table <- from this moment forward none of the tables selection works properly

Suggested Severity

None

Application/PAL

No response

Code of Conduct

@Gururajj77 Gururajj77 added severity: 2 https://ibm.biz/carbon-severity severity: 3 https://ibm.biz/carbon-severity component: data-table and removed severity: 2 https://ibm.biz/carbon-severity status: needs triage 🕵️‍♀️ labels Jun 21, 2024
@Gururajj77 Gururajj77 moved this to ⏱ Backlog in Design System Jun 21, 2024
@Gururajj77 Gururajj77 added severity: 2 https://ibm.biz/carbon-severity and removed severity: 3 https://ibm.biz/carbon-severity labels Jun 21, 2024
@tay1orjones
Copy link
Member

@FFahrenheit I found this from a related PR:

If a user has multiple radio tables, they would just need to pass in their own name prop to TableSelectRow after the getSelectionProps

It does fix it, here's an example, though I wonder if we could fix this without reintroducing the bug that that PR fixed.

@tay1orjones tay1orjones added severity: 3 https://ibm.biz/carbon-severity and removed severity: 2 https://ibm.biz/carbon-severity labels Jun 25, 2024
@FFahrenheit
Copy link
Author

Hi @tay1orjones that fixed the issue for me! Thank you :)
image

@guidari guidari self-assigned this Jul 17, 2024
@guidari guidari moved this from ⏱ Backlog to 🚦 In Review in Design System Jul 24, 2024
@github-project-automation github-project-automation bot moved this from 🚦 In Review to ✅ Done in Design System Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants