You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing the Accessibility Requirement 1.31 violation Element "button" should not be focusable within the subtle of an element with an 'aria-hidden' attribute with value 'true' whenever we create a Toggle with hideLabel and have labelText set to a label with a Tooltip component wrapping a button.
The Toggle component appears to be adding aria-hidden="true" when hideLabel is included, which is causing this error here because the tooltip generates a button, and a button should not be focusable (as it is) within a subtree where 'aria-hidden' is set to "true", as the error describes. But, to keep visual formatting with toggle only having a side-label, we cannot remove hideLabel nor the Tooltip component wrapping a button from the label as we would like to have only a side-label with the tooltip and no top-level label on the toggle.
Requesting the Toggle component be updated to support Tooltip components that wrap buttons in the labelText when hideLabel is set so that we can still have labelText replace the side labels and the toggle not render a top level without causing accessibility issues here.
Package
@carbon/react
Browser
Chrome
Operating System
MacOS
Package version
^1.40.0
React version
^18.2.0
Automated testing tool and ruleset
IBM Equal Access Accessibility Checker
Assistive technology
N/A
Description
I am seeing the Accessibility Requirement 1.31 violation
Element "button" should not be focusable within the subtle of an element with an 'aria-hidden' attribute with value 'true'
whenever we create aToggle
withhideLabel
and havelabelText
set to a label with aTooltip
component wrapping a button.The
Toggle
component appears to be addingaria-hidden="true"
whenhideLabel
is included, which is causing this error here because the tooltip generates a button, and a button should not be focusable (as it is) within a subtree where 'aria-hidden' is set to "true", as the error describes. But, to keep visual formatting with toggle only having a side-label, we cannot removehideLabel
nor theTooltip
component wrapping a button from the label as we would like to have only a side-label with the tooltip and no top-level label on the toggle.Requesting the
Toggle
component be updated to supportTooltip
components that wrap buttons in thelabelText
whenhideLabel
is set so that we can still havelabelText
replace the side labels and the toggle not render a top level without causing accessibility issues here.WCAG 2.1 Violation
Accessibility Requirement 1.31
Reproduction/example
https://stackblitz.com/edit/github-eb95fx?file=src%2FApp.jsx
Steps to reproduce
Create a Toggle component with
hideLabel
set to "true" andlabelText
set to some text with aTooltip
component wrapping a button.Suggested Severity
Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.
Code of Conduct
The text was updated successfully, but these errors were encountered: