Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Option Group ID attributes do not strip spaces #32

Open
jacksonhyde opened this issue Dec 8, 2020 · 0 comments
Open

Option Group ID attributes do not strip spaces #32

jacksonhyde opened this issue Dec 8, 2020 · 0 comments

Comments

@jacksonhyde
Copy link

jacksonhyde commented Dec 8, 2020

Currently the id attribute value for many elements is derived from the value of the field or field option. Without any formatting it is possible for an ID to contain spaces (and presumably other non-spec characters).

You can see this in action on the Electronic Visa Waiver form flow:

image

This does violate the HTML spec, but a more pragmatic issue is that it prevents the label being associated with the button in the NVDA screenreader.

Perhaps we could add an id attribute to the options objects created in lib/template-mixins.js which stripped out illegal chars and formatted to an appropriate case (kebab case)?

This may be an issue with other elements, but so far we've only had issues with option groups.

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

No branches or pull requests

1 participant