diff --git a/packages/@react-aria/collections/src/Document.ts b/packages/@react-aria/collections/src/Document.ts index f7fb5f61d7c..dd1dbeb4f36 100644 --- a/packages/@react-aria/collections/src/Document.ts +++ b/packages/@react-aria/collections/src/Document.ts @@ -344,6 +344,9 @@ export class ElementNode extends BaseNode { node.rendered = rendered; node.render = render; node.value = value; + if (obj['aria-label']) { + node['aria-label'] = obj['aria-label']; + } node.textValue = textValue || (typeof props.children === 'string' ? props.children : '') || obj['aria-label'] || ''; if (id != null && id !== node.key) { throw new Error('Cannot change the id of an item'); diff --git a/packages/react-aria-components/stories/ComboBox.stories.tsx b/packages/react-aria-components/stories/ComboBox.stories.tsx index b825b6dd721..4aa528a18bb 100644 --- a/packages/react-aria-components/stories/ComboBox.stories.tsx +++ b/packages/react-aria-components/stories/ComboBox.stories.tsx @@ -367,3 +367,25 @@ export function WithCreateOption() { ); } + +export const ComboBoxListBoxItemWithAriaLabel: ComboBoxStory = () => ( + + +
+ + +
+ + + Item Foo + Item Bar + Item Baz + + +
+);