Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
289 stars 76 forks source link

Epic: Component a11y consistency with `disabled` and `aria-disabled` attributes (2036570545) #7775

Open dqateam opened 1 year ago

dqateam commented 1 year ago

Violation:

Ensure ARIA roles, states, and properties are valid. In each case both the disabled and aria-disabled attributes are added causing error reports across the design system.

<button
          ...
          aria-disabled={toAriaBoolean(disabled)}
          ...
          disabled={disabled}

Fix

Calcite should get rid of the aria-disabled where disabled is present.

We could consider an eslint rule to prevent both aria-disabled and disabled from being set in the JSX per Matt's recommendation in the list-item issue https://github.com/Esri/calcite-design-system/issues/7796#issuecomment-1799429020.

Components affected

image

WCAG Reference:

Severity:

5

Media Type:

ARIA


Areas for Remediation:

Issue There are elements with invalid ARIA attribute aria-disabled="true" as it already has native HTML disabled attribute.

Occurrences 04 Action

User Impact Assistive technologies may be unable to parse this content.

[Code R eference]

(..)

Suggestion Ensure ARIA roles, states, and properties are valid. Many ARIA attributes can only be used on certain elements. Some can only be used in combination with other attributes. Additionally, if an attribute references an ID, that ID must be present in the page.

To detect many of these errors automatically, use the Nu Html Checker: https://validator.w3.org/nu/

Compliant Code Example

<div calcite-hydrated="" tabindex="-1" summary="Materials or substances such as minerals, forests, water, and fertile land that occur in nature and can be used for economic gain." heading="Natural Resources" disabled="">
(..)
</div>

Additional Resources:

geospatialem commented 10 months ago

This issue includes multiple components, but will need some additional insights and direction from the testers to determine next steps.

Components affected:

geospatialem commented 8 months ago

Sought expertise from our vendor, which concurred with our initial thoughts:

  1. Set up a test that prevents both aria-disabled and disabled from being set
  2. Remove aria-disabled in favor of disabled

Updating the estimate to a 5 since this impacts 21 components, but we could implement a test that reaches all components in the design system.

github-actions[bot] commented 8 months ago

cc @geospatialem, @brittneytewks

driskull commented 1 month ago

@geospatialem the only valid instance of this is found on action.

https://github.com/Esri/calcite-design-system/blob/06c96e99580f810cba73c37465734f338006c825/packages/calcite-components/src/components/action/action.tsx#L318-L322

All the other instances are a result of the interactive helper.

https://github.com/Esri/calcite-design-system/blob/06c96e99580f810cba73c37465734f338006c825/packages/calcite-components/src/utils/interactive.tsx#L73-L74

These components have a disabled property on them still need the aria-disabled as well because they are not native HTML elements that have a disabled attribute/property. I think the tool reporting these instances is wrong.

driskull commented 1 month ago

@jcfranco if we did want to try and adjust this, we would need to move the aria-disabled to a container within the component and not on the host.

driskull commented 1 month ago

@geospatialem can we spike this one to determine if we need to remove setting aria-disabled on disabled components?

geospatialem commented 1 month ago

@geospatialem can we spike this one to determine if we need to remove setting aria-disabled on disabled components?

@driskull Believe when we checked in with our consultant earlier this year it was recommended to remove aria-disabled when setting disabled.

driskull commented 1 month ago

@geospatialem I wonder if they understand these are web components and not HTML elements like an input or button that have a disabled attribute/property. They may be missing some context.

geospatialem commented 1 month ago

Once https://github.com/Esri/calcite-design-system/pull/10374 is merged the remaining components, with the helper, as-is.

When we conduct the audit with our third party vendor in early 2025 we should communicate that its best to interpret the contents as-is to determine if assistive technologies are unable to parse content, or if this surfaces since the custom disabled and aria-disabled are present in the HTML markup. cc @driskull

geospatialem commented 1 week ago

Once #10374 is merged the remaining components, with the helper, as-is.

When we conduct the audit with our third party vendor in early 2025 we should communicate that its best to interpret the contents as-is to determine if assistive technologies are unable to parse content, or if this surfaces since the custom disabled and aria-disabled are present in the HTML markup. cc @driskull

Changed assignment to address/communicate with Level for the 2025 audit.