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

Enumerate legends in Add another #160

Open
gregtyler opened this issue Jun 4, 2021 · 0 comments
Open

Enumerate legends in Add another #160

gregtyler opened this issue Jun 4, 2021 · 0 comments
Labels
accessibility enhancement New feature or request

Comments

@gregtyler
Copy link
Contributor

NB: This is a breaking change

When you use the Add another component to add an additional item, the legend on the form is identical to the original one: in the MOJDS docs example there would be two or more legends called "Person".

This makes it hard for users with screen readers to navigate the form, because the screen reader cannot distinguish between each fieldset.

To make this clearer, we should automatically enumerate the legends by appending an index number with JavaScript. i.e. when you "add another", the original legend will become "Person 1" and the new one will be "Person 2".

In order to support services which don't want this distinction, if the form has the attribute data-moj-add-another-enumerate="false" then the auto-enumeration should not occur. This opt-out mechanism will need to be documented.

@gregtyler gregtyler added enhancement New feature or request accessibility labels Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant