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

FastPass Does Not Associate Labels with Custom Elements #6798

Closed
break-stuff opened this issue Jul 8, 2023 · 5 comments
Closed

FastPass Does Not Associate Labels with Custom Elements #6798

break-stuff opened this issue Jul 8, 2023 · 5 comments
Assignees
Labels
bug Something isn't working status: ready for triage This issue is ready to be triaged by the Accessibility Insights team.

Comments

@break-stuff
Copy link

break-stuff commented Jul 8, 2023

Describe the bug

When using the ElementInternals API, form-associated custom elements are showing a missing label error when a label is associated with it.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://cdpn.io/break-stuff/fullpage/qBQPGVb?nocache=true&view=fullpage'
  2. Run Accessibility Insights FastPass

CodePen repro example

https://codepen.io/break-stuff/pen/qBQPGVb?editors=1011

Expected behavior

It should correctly associate the label with the component.

Screenshots

Context (please complete the following information)

Are you willing to submit a PR?

No

Did you search for similar existing issues?

Yes

Additional context

@break-stuff break-stuff added the bug Something isn't working label Jul 8, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the status: new This issue is new and requires triage by DRI. label Jul 8, 2023
@codeofdusk codeofdusk added the status: ready for triage This issue is ready to be triaged by the Accessibility Insights team. label Jul 8, 2023
@microsoft-github-policy-service
Copy link
Contributor

This issue has been marked as ready for team triage; we will triage it in our weekly review and update the issue. Thank you for contributing to Accessibility Insights!

@microsoft-github-policy-service microsoft-github-policy-service bot removed the status: new This issue is new and requires triage by DRI. label Jul 8, 2023
@DaveTryon
Copy link
Contributor

DaveTryon commented Jul 10, 2023

Looking at this, I suspect that the problem isn't the custom control, but that the custom control is a node inside a shadow DOM, while the label is outside the shadow DOM, even though the shadow DOM is open. Several posts online (including this one from WilcoFiers of the axe team) suggest that it's intentional behavior for an IDREF property to cross a shadow DOM boundary. That's how shadow DOM provides isolation between the contents of multiple (and potentially conflicting) elements within shadow DOMs on the same page.

Addendum: I confirmed in the HTML document spec that label for uses an IDREF.

@DaveTryon DaveTryon assigned break-stuff and unassigned codeofdusk and nang4ally Jul 10, 2023
@DaveTryon
Copy link
Contributor

We believe this is by design for the reasons listed above. Please reopen it if you find formal documentation that suggests that the label tag is intended to be able to apply to items within a shadow root.

@DaveTryon DaveTryon closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2023
@break-stuff
Copy link
Author

Creating form-associated custom elements using the ElementInternals API allows custom elements to behave as input elements and be associated with forms and labels.

https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals

@break-stuff
Copy link
Author

For more information, this ticket was elevated to axe-core.

dequelabs/axe-core#4085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status: ready for triage This issue is ready to be triaged by the Accessibility Insights team.
Projects
None yet
Development

No branches or pull requests

4 participants