UKHO / admiralty-design-system

MIT License
5 stars 0 forks source link

[BUG] ARC Tool issue - Aria attribute is not allowed #211

Closed Satyam15302 closed 1 day ago

Satyam15302 commented 3 months ago

Describe the bug

The aria-label attribute is being used on elements with the generic role, which is not allowed. This violates WCAG 2.2 Success Criterion 4.1.2 (Name, Role, Value).

To Reproduce

Steps to reproduce the behavior:

  1. Open the web application.

  2. Navigate to the "Confirm exchange set content" page or "Selecting ENCs" page.

  3. Use a web accessibility testing tool (e.g., ARC Toolkit).

  4. Observe the error regarding the use of aria-label on generic role elements.

Expected behavior

The aria-label attribute should not be used on elements with the generic role. Instead, elements should use roles that allow the aria-label attribute, such as button, checkbox, etc.

Screenshots

ARIA attribute is not allowed ARIA attribute is not allowed-File Upload

Additional context

developernm commented 1 week ago

The user adding the aria-label tag to the host element being <admiralty-checkbox> is causing the error "The 'aria-label' attribute is being used on elements with the generic role".

As the component already contains a label nested within, the users need to add an aria-label tag is redundant.

The suggestion of implementing logic to have the label hidden but still visible for screen readers is a possibility, but wouldn't stop the user from getting this error, as they've added the property themselves.

Also after looking into this component, there is another issue regards to the click event behaving differently when clicking inside, outside or on the border of the checkbox.

developernm commented 1 week ago

PR - fix