Esri / calcite-design-system

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

Ensure toAriaBoolean is used in rendering #8976

Open jcfranco opened 3 months ago

jcfranco commented 3 months ago

Description

Stems from https://github.com/Esri/calcite-design-system/pull/8962#discussion_r1529793935.

Not sure if this is related to the issue, but this, and similar lines, should be using toAriaBoolean (see example). In its current form, it's setting a boolean on the attribute instead of "true" or "false".

Proposed Advantages

ARIA-related boolean attributes need to be explicitly set to "true"/"false" to be interpreted correctly.

Which Component

Relevant Info

No response

Calcite package

driskull commented 3 months ago

This is one downside of a tiny JSX library. I wonder if we could add an eslint rule for this or open an enhancement for Stencil?

If stencil did at something it would have to probably add all aria like ariaHidden={true}

jcfranco commented 3 months ago

I like the idea of adding a custom ESLint rule for this. cc @Elijbet