Skip to content

Commit 8173dda

Browse files
authored
docs(RAC): various docs examples accessibility fixes (#6607)
1 parent 8a8cabe commit 8173dda

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/react-aria-components/docs/CheckboxGroup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function MyCheckboxGroup({
194194
}: MyCheckboxGroupProps) {
195195
return (
196196
<CheckboxGroup {...props}>
197-
{label}
197+
{label && <Label>{label}</Label>}
198198
{children}
199199
{description && <Text slot="description">{description}</Text>}
200200
<FieldError>{errorMessage}</FieldError>

packages/react-aria-components/docs/ColorField.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ A ColorField accepts either a color string or <TypeLink links={docs.links} type=
217217
By default, `ColorField` is uncontrolled. You can set a default value using the `defaultValue` prop.
218218

219219
```tsx example
220-
<MyColorField defaultValue="#7f007f" />
220+
<MyColorField label="Color" defaultValue="#7f007f" />
221221
```
222222

223223
### Controlled
@@ -233,7 +233,7 @@ function Example() {
233233
let [color, setColor] = React.useState(parseColor('#7f007f'));
234234
return (
235235
<>
236-
<MyColorField value={color} onChange={setColor} />
236+
<MyColorField label="Color" value={color} onChange={setColor} />
237237
<p>Current color value: {color.toString('hex')}</p>
238238
</>
239239
);

packages/react-aria-components/docs/ListBox.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ let albums = [
598598
items={albums}
599599
selectionMode="multiple">
600600
{item => (
601-
<ListBoxItem>
601+
<ListBoxItem textValue={item.title}>
602602
<img src={item.image} alt="" />
603603
<Text slot="label">{item.title}</Text>
604604
<Text slot="description">{item.artist}</Text>
@@ -687,7 +687,7 @@ The `layout` prop can be set to `"grid"` to enable two-dimensional keyboard navi
687687
items={albums}
688688
selectionMode="multiple">
689689
{item => (
690-
<ListBoxItem>
690+
<ListBoxItem textValue={item.title}>
691691
<img src={item.image} alt="" />
692692
<Text slot="label">{item.title}</Text>
693693
<Text slot="description">{item.artist}</Text>
@@ -723,7 +723,7 @@ The `layout="grid"` and `orientation="horizontal"` props can be combined to buil
723723
items={albums}
724724
selectionMode="multiple">
725725
{item => (
726-
<ListBoxItem>
726+
<ListBoxItem textValue={item.title}>
727727
<img src={item.image} alt="" />
728728
<Text slot="label">{item.title}</Text>
729729
<Text slot="description">{item.artist}</Text>

0 commit comments

Comments
 (0)