fix(data-table): prefix internal ID for radio button, checkbox (#2082)

Fixes #2081
This commit is contained in:
Eric Liu 2025-01-19 16:22:23 -08:00
commit dd6cbac3ee
3 changed files with 37 additions and 2 deletions

View file

@ -0,0 +1,19 @@
<script lang="ts">
import { DataTable } from "carbon-components-svelte";
const headers = [
{ key: "id", value: "id" },
{ key: "contact.company", value: "Company name" },
] as const;
const rows = [
{ id: "1", contact: { company: "Company 1" } },
{ id: "2", contact: { company: "Company 2" } },
];
</script>
<DataTable radio {headers} {rows} />
<DataTable radio {headers} {rows} />
<DataTable batchSelection selectable {headers} {rows} />
<DataTable batchSelection selectable {headers} {rows} />