Skip to content

Commit

Permalink
Merge pull request #5851 from ilzamcmed/LPD-1277
Browse files Browse the repository at this point in the history
fix(@clayui/tree-view): LPD-1277 TreeView with checkbox need a label
  • Loading branch information
matuzalemsteles authored Aug 8, 2024
2 parents 875aa75 + d368dce commit a1503fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/clay-core/src/tree-view/TreeViewItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ export function TreeViewItemStack({
// @ts-ignore
} else if (child?.type.displayName === 'ClayCheckbox') {
content = React.cloneElement(child as React.ReactElement, {
'aria-labelledby': labelId,
checked: selection.selectedKeys.has(item.key),
disabled: loading || disabled,
indeterminate: selection.isIndeterminate(item.key),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ exports[`TreeView basic rendering render with checkbox 1`] = `
>
<label>
<input
aria-labelledby="clay-id-96"
class="custom-control-input"
type="checkbox"
/>
Expand Down Expand Up @@ -524,6 +525,7 @@ exports[`TreeView basic rendering render with item active 1`] = `
>
<label>
<input
aria-labelledby="clay-id-160"
class="custom-control-input"
type="checkbox"
/>
Expand Down Expand Up @@ -626,6 +628,7 @@ exports[`TreeView basic rendering render with text 1`] = `
>
<label>
<input
aria-labelledby="clay-id-106"
class="custom-control-input"
type="checkbox"
/>
Expand Down

0 comments on commit a1503fa

Please sign in to comment.