Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2326 Accessibility Violations in Common Properties Controls without Label #2327

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

srikant-ch5
Copy link
Contributor

Fixes: #2326

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

@srikant-ch5 srikant-ch5 self-assigned this Jan 28, 2025
@srikant-ch5 srikant-ch5 marked this pull request as draft January 28, 2025 13:36
@srikant-ch5
Copy link
Contributor Author

srikant-ch5 commented Jan 28, 2025

Hi @matthoward366

I have removed below condition from control-item.
this.props.control.labelVisible !== false

This is will allow Control Item to have a label so that screen reader is able to read even in case of label_visible: false.
Allowed Carbon to take control of hiding the label using hideLabel prop, after implementing this solution there is no violation for control with no label. Please let me know whether this solution would work or I need to look into other alternatives ?

Below is the control element with above condition.
Screenshot 2025-01-28 at 5 30 13 PM

Below is the control element without above condition.
Screenshot 2025-01-28 at 5 30 35 PM

@matthoward366
Copy link
Member

This seems fine as long as all controls are covered by this.

@srikant-ch5
Copy link
Contributor Author

srikant-ch5 commented Jan 31, 2025

This seems fine as long as all controls are covered by this.

Changed the approach by including display: none for label_visible: false control and include aria-label in the controls to resolve violations.

Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
@srikant-ch5 srikant-ch5 marked this pull request as ready for review February 4, 2025 05:20
@srikant-ch5
Copy link
Contributor Author

srikant-ch5 commented Feb 10, 2025

@matthoward366 could you please have a look at this PR ?

Reason for not including aria-label=this.props.control?.label?.text for visible label is it control.label.text should be appended with required or optional indicators. This flagged another violation of label mismatch with aria-label, so assigned null instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility Violations in Common Properties Controls without Label
2 participants