Skip to content

Commit c1fd8af

Browse files
authored
fix(s2): Add role=presentation to ListBox section headings (adobe#8213)
1 parent 1390063 commit c1fd8af

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

packages/@react-spectrum/s2/src/ComboBox.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,11 @@ const ComboboxInner = forwardRef(function ComboboxInner(props: ComboBoxProps<any
660660
<Provider
661661
values={[
662662
[HeaderContext, {styles: listboxHeader({size})}],
663-
[HeadingContext, {styles: sectionHeading}],
663+
[HeadingContext, {
664+
// @ts-ignore
665+
role: 'presentation',
666+
styles: sectionHeading
667+
}],
664668
[TextContext, {
665669
slots: {
666670
'description': {styles: description({size})}

packages/@react-spectrum/s2/src/Menu.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,11 @@ export const Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(function Menu<T
361361
<Provider
362362
values={[
363363
[HeaderContext, {styles: sectionHeader({size})}],
364-
[HeadingContext, {styles: sectionHeading}],
364+
[HeadingContext, {
365+
// @ts-ignore
366+
role: 'presentation',
367+
styles: sectionHeading
368+
}],
365369
[TextContext, {
366370
slots: {
367371
'description': {styles: description({size})}

packages/@react-spectrum/s2/src/Picker.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,11 @@ export const Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(function Pick
412412
<Provider
413413
values={[
414414
[HeaderContext, {styles: listboxHeader({size})}],
415-
[HeadingContext, {styles: sectionHeading}],
415+
[HeadingContext, {
416+
// @ts-ignore
417+
role: 'presentation',
418+
styles: sectionHeading
419+
}],
416420
[TextContext, {
417421
slots: {
418422
description: {styles: description({size})}

packages/@react-spectrum/s2/src/TabsPicker.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,11 @@ function Picker<T extends object>(props: PickerProps<T>, ref: FocusableRef<HTMLB
253253
<Provider
254254
values={[
255255
[HeaderContext, {styles: sectionHeader({size})}],
256-
[HeadingContext, {styles: sectionHeading}],
256+
[HeadingContext, {
257+
// @ts-ignore
258+
role: 'presentation',
259+
styles: sectionHeading
260+
}],
257261
[TextContext, {
258262
slots: {
259263
description: {styles: description({size})}

0 commit comments

Comments
 (0)