Skip to content

FORMS-18671: Visible label missing @sunnym @vavarshn #1603

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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

stefan-dragomir
Copy link

@stefan-dragomir stefan-dragomir commented Jun 4, 2025

Description

Related Issue

https://jira.corp.adobe.com/browse/FORMS-18671

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

aria-describedby="${file.id}__errormessage ${file.id}__longdescription ${file.id}__shortdescription"
data-cmp-data-layer="${file.data.json}"
/>
<div class="cmp-adaptiveform-fileinput__widget-container">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a V3 component. You should update the HTML in the latest version, but V3 component already includes a container

.

Copy link
Author

@stefan-dragomir stefan-dragomir Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in V3. Also changed the name of the container to align with the #syncAriaLabel() update. V1 remained changed as well.

<div data-sly-test="${!tnc.showLink}" class="cmp-adaptiveform-termsandcondition__text">
<div data-sly-resource="${'text'}"></div>
<div class="cmp-adaptiveform-termsandcondition__text-intersect"></div>
<div class="cmp-adaptiveform-termsandcondition__widget-container">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it necessary to add a new container element? Is it not possible with the existing container element cmp-adaptiveform-termsandcondition__content-containe?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed a container to encapsulate both the T&C text description and checkbox (for using with label and role). On Win+NVDA keyboard navigation will skip directly to the Checkbox, ignoring the fact it's part of a component.

@@ -14,7 +14,7 @@
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
<template data-sly-template.widget="${ @ checkboxgroup }">
<div class="cmp-adaptiveform-checkboxgroup__widget ${checkboxgroup.orientation}" id="${widgetId}">
<div class="cmp-adaptiveform-checkboxgroup__widget ${checkboxgroup.orientation}" id="${widgetId}" role="group">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add the role="group" attribute, you must connect the label to the group using the aria-labelledby attribute.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added logic in FormFieldBase.js for this. Should help both CheckboxGroup and RadioGroup.

// Some elements have the Widget hidden by default and other are Panels
// So this container mimics having a single, showing widget to attach the Accessibility label to.
if(regionContainer) {
regionContainer.setAttribute('role', 'region');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role="region" attribute is not required to meet WCAG. It is the best practice.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVDA on Windows will ignore the div element despite having an aria-label. role="region" was the best compromise I could find for this situation.

Custom Label without Region
Custom Label with Region

Copy link
Contributor

@amit-mnnit amit-mnnit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check comments

@stefan-dragomir
Copy link
Author

Updated code and added my answers.

@vaibhav2601 vaibhav2601 requested a review from amit-mnnit June 24, 2025 08:20
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.

2 participants