Skip to content

Commit 756b366

Browse files
committed
chore: add web accessibility features
1 parent d603173 commit 756b366

File tree

1 file changed

+7
-2
lines changed
  • packages/react-toggle-file-tree/src/toggle-file-tree

1 file changed

+7
-2
lines changed

packages/react-toggle-file-tree/src/toggle-file-tree/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ function renderFileList(
7878
if (Array.isArray(value)) {
7979
const files = value;
8080
return (
81-
<FileContainer key={key}>
81+
<FileContainer key={key} role="tree">
8282
{files.map((file) => {
8383
return (
8484
<File
85+
role="treeitem"
8586
key={`FILE-${file.fileName}-${index}-${Math.random()
8687
.toString()
8788
.substring(2, 10)}`}
@@ -110,7 +111,11 @@ function renderFileList(
110111
📁 <span style={{ marginLeft: 4, fontSize: 15 }}>{key}</span>
111112
</p>
112113
</CheckboxContainer>
113-
<Checkbox id={`CHECKBOX-${index}-${key}`} type="checkbox" />
114+
<Checkbox
115+
id={`CHECKBOX-${index}-${key}`}
116+
type="checkbox"
117+
role="checkbox"
118+
/>
114119
{renderFileList(
115120
value as FileList,
116121
handleFileClick,

0 commit comments

Comments
 (0)