Skip to content

Selecting a row on one DataTable unchecks radio button on another DataTable #2081

Closed
@bhavers

Description

@bhavers

Problem:

  • Selecting a row in one DataTable will result in unselecting the radio button of a row with the same id of another DataTable on the same page.

Situation:

  • Two DataTables on the same page.
  • DataTables using radio buttons for selection.
  • Both DataTables use the same id property for the rows.

Reproduce issue:

Analysis
See analysis of @theetrain on Discord.

It appears that when radio={true} on the DataTable, the name attribute is set as the row's ID. I think the radio prop ought to accept a string as the desired name, and then its value attribute would be the Row's ID.
In other words, a row with an id abc123 should have a radio input like this:
<input type="radio" name="table-1-row" value="abc123" />
Link to code:

name="select-row-{row.id}"

Workaround:

  • use different id's for DataTables.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions