"Certain ARIA roles must contain particular children"
This critical issue is being caused by Carbon's rendering of the <h4> tag in the DOM, as a sibling to of the list of (correct) <li> node, that are the only valid children of the parent <ul> tag...
Even if <h4> is wrapped inside of a <li> tag, AXE still gives an accessibility warning about semantical order of the heading <h1...h5 /> tags, though the warning level which is no longer critical.
This is produced simply by using the documented <OptionGroupHeader /> component among the array of <Option /> components, when implementing the <Select />, which purpose is to visually and group options via a bold non-option, non-clickable heading..
JIRA ticket numbers (Sage only)
SBS-92771
Suggested solution
In order to avoid this AXE warning, perhaps the <OptionGroupHeader /> component could:
wrap the heading in a <li> tag, to ensure all direct children of <ui> are correctly <li>
for the heading text, using a strong, heavier weight without actually using <h4> to avoid the semantic ordering issue (check accessibility guidelines for this)
Carbon version
v134.0.0 (latest, and older versions)
Design tokens version
No response
Relevant browsers
Firefox, Chrome, Safari, Microsoft Edge
Relevant OSs
MacOS, Windows, Linux
Additional context
No response
Confidentiality
[X] I confirm there is no confidential or commercially sensitive information included.
Description
For Carbon Select dropdown menu with grouped Options: AXE DevTools correctly displays what is flagged as a critical accessibility issue:
"Certain ARIA roles must contain particular children"
This critical issue is being caused by Carbon's rendering of the
<h4>
tag in the DOM, as a sibling to of the list of (correct)<li>
node, that are the only valid children of the parent<ul>
tag...Even if
<h4>
is wrapped inside of a<li>
tag, AXE still gives an accessibility warning about semantical order of the heading<h1...h5 />
tags, though the warning level which is no longer critical.Reproduction
https://carbon.sage.com/?path=/docs/select--docs#option-groups
Steps to reproduce
This is produced simply by using the documented
<OptionGroupHeader />
component among the array of<Option />
components, when implementing the<Select />
, which purpose is to visually and group options via a bold non-option, non-clickable heading..JIRA ticket numbers (Sage only)
SBS-92771
Suggested solution
In order to avoid this AXE warning, perhaps the
<OptionGroupHeader />
component could:<li>
tag, to ensure all direct children of<ui>
are correctly<li>
<h4>
to avoid the semantic ordering issue (check accessibility guidelines for this)Carbon version
v134.0.0 (latest, and older versions)
Design tokens version
No response
Relevant browsers
Firefox, Chrome, Safari, Microsoft Edge
Relevant OSs
MacOS, Windows, Linux
Additional context
No response
Confidentiality