You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Form's submit button ignores submitBtnLabel for its accessible name (hardcoded aria-label="Submit") #108
Form's submit button hardcodes aria-label="Submit" regardless of submitBtnLabel, so its accessible name never matches its visible label.
Where
src/components/Form/Form.tsx — the submit button's aria-label is a literal, not derived from submitBtnLabel.
Effect
The visible text and the accessible name disagree whenever a caller passes a custom label. Confirmed in Open Data Capture on two forms:
Visible label
Accessible name
"Login"
"Submit"
"Save"
"Submit"
This is a WCAG 2.5.3 Label in Name failure: a speech-input user saying "click Save" cannot activate the button. It also means every test that targets the button by its visible label has to use getByRole('button', { name: 'Submit' }) instead — which is how the whole Open Data Capture Playwright suite currently does it.
Suggested fix
Derive the aria-label from submitBtnLabel when one is provided, falling back to "Submit" only when it is not. If the label is already rendered as the button's visible text content, the aria-label may be unnecessary altogether — an accessible name computed from content would track the visible label automatically.
Notes
Found while writing end-to-end coverage for Open Data Capture, which consumes this package.
Two more cases with the same cause (checked at a1197cf, src/components/Form/Form.tsx):
Translated default label. With no submitBtnLabel, the visible text is t('form.submit'). In Spanish the button shows "Enviar", but the accessible name is still "Submit" (line 255). So the mismatch also occurs for every non-English user, not only with a custom label.
Reset button. It has the same hard-coded aria-label="Reset" (line 279), while its visible text is t('form.reset').
Removing both aria-label attributes would fix all cases, because the visible text content then gives the accessible name.
Activity
link each BUGS.md finding to its upstream issue
drop BUGS.md now that every finding is filed upstream
gdevenyi commentedon Oct 14, 2026
Two more cases with the same cause (checked at a1197cf,
src/components/Form/Form.tsx):submitBtnLabel, the visible text ist('form.submit'). In Spanish the button shows "Enviar", but the accessible name is still "Submit" (line 255). So the mismatch also occurs for every non-English user, not only with a custom label.aria-label="Reset"(line 279), while its visible text ist('form.reset').Removing both
aria-labelattributes would fix all cases, because the visible text content then gives the accessible name.