Skip to content

Commit ce034e5

Browse files
chore(table): checkboxes and multi select stories
the indeterminate checkbox for a multi-select table should only show in the header row. Single select tables should not have a checkbox in the header row.
1 parent 1ffe361 commit ce034e5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

components/table/stories/template.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,16 @@ export const Template = ({
299299
class="spectrum-Table-headCell spectrum-Table-checkboxCell"
300300
role=${ifDefined(useDivs ? "columnheader" : undefined)}
301301
>
302-
${Checkbox({
303-
size: "m",
304-
isEmphasized: isEmphasized,
305-
isChecked: false,
306-
isIndeterminate: selectionMode === "multiple" ? true : undefined,
307-
customClasses: [`${rootClass}-checkbox`],
302+
${when(selectionMode === "multiple", () => html`
303+
${Checkbox({
304+
size: "m",
305+
isEmphasized: isEmphasized,
306+
isChecked: false,
307+
isIndeterminate: true,
308+
customClasses: [`${rootClass}-checkbox`],
308309
}, context)}
309-
</${thTag}>`
310+
`)}
311+
</${thTag}>`,
310312
)}
311313
<${thTag}
312314
class="${rootClass}-headCell is-sortable"

0 commit comments

Comments
 (0)