Required asterisk is part of the accessible name of form controls
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- accessibility, frontend
Research direction
Start in src/functional-components/form-control/form-control.scss and trace how the required label is rendered and referenced by aria-labelledby. The issue includes a Playwright reproduction for six-input and six-textarea; run that check and confirm their accessible names are Name while the required state remains exposed. The same label is used by several other components listed in the issue.
Written by the indexing model from the issue text.
Description
Six Webcomponents version
5.5.2 (reproduced on main at 4368add7e)
Steps to reproduce
-
Render a required field:
<six-input label="Name" required></six-input> <six-textarea label="Name" required></six-textarea> -
Inspect the inner
<input>/<textarea>in the browser accessibility tree (DevTools > Elements > Accessibility > Computed Properties > Name).
Alternatively, the same check as a Playwright test, using the repository fixture (src/test-utils/fixtures):
for (const tag of ['six-input', 'six-textarea']) {
test(`${tag} required label name`, async ({ page }) => {
await page.setContent(`<${tag} label="Name" required></${tag}>`);
await expect(page.getByRole('textbox')).toHaveAccessibleName('Name');
});
}
What is expected?
The accessible name is the label text only: Name. The required state is already exposed through the native required attribute.
What is actually happening?
The accessible name is Name *, so screen readers read the asterisk as part of the field name.
Error: expect(locator).toHaveAccessibleName(expected) failed
Expected: "Name"
Received: "Name *"
The asterisk comes from CSS generated content on the <label> that is referenced by aria-labelledby, in src/functional-components/form-control/form-control.scss:
.form-control__label__required::after {
content: '*';
...
}
The accessible name computation includes CSS ::before / ::after content (accname 1.2, step 2F.ii), so every component that renders FormControl with required is affected. Verified for six-input and six-textarea; six-select, six-checkbox, six-range, six-rating, six-switch and six-group-label use the same FormControl label.
Any additional comments?
Suggested fix: render the asterisk as a decorative element that is excluded from the accessible name, for example <span class="form-control__label__required" aria-hidden="true">*</span> inside the label, instead of the ::after pseudo-element. An alternative is CSS alternative text (content: '*' / ''), but browser support for it is not complete.
This is not a WCAG conformance failure: the computed name still contains the visible label (SC 2.5.3). The asterisk is a visual marker for the required state, which the native required attribute already exposes, so it duplicates that information in the field name.
Confirmed with Windows Narrator: the asterisk is read as part of the field name.
We found this in an Angular 21 application (@six-group/ui-library-angular 5.5.2) and reproduced it in this repository without any application code.
- Dominant language
- TypeScript
- Stars
- 30
- Forks
- 14
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 5
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from six-group/six-webcomponents
-
breaking change v6
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
six-group/six-webcomponents#573 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
six-group/six-webcomponents#601 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
six-group/six-webcomponents#597 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
six-group/six-webcomponents#593 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
six-group/six-webcomponents#553 ·
All issues in six-group/six-webcomponents
Similar issues
-
area: batch
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
inabagumi/shinju-date#7294 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
streaming-video-technology-alliance/common-media-library#700 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vercel-labs/ui#809 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
KrisCris/village-in-the-shade-guide#75 ·
Maintainers usually reply within 1 day
-
bot:ai-assisted component:platform-js status:untriaged
Difficulty 1/5 Under an hour Newbie friendliness 74/100
midnightntwrk/platform-js#38 ·