-
Notifications
You must be signed in to change notification settings - Fork 24
Description
We get HTML ids for elements from this method:
| def build_id(id_type, delimiter = '-', replace = '_', attribute_name: nil, include_value: true) |
So when creating checkboxes with values 1, 2, 3, we get elements with ids my-checkbox-1-field, my-checkbox-2-field, my-checkbox-3-field etc.
If we instead want to create checkboxes with values -1, -2, -3, we still get elements with ids my-checkbox-1-field, my-checkbox-2-field, my-checkbox-3-field due to the parameterize call in the above method.
There are some use cases where we want checkboxes with values that are both positive and negative. For example, for school years, you may have checkboxes for Nursery, Reception, Year 1, Year 2, which correspond to values -1, 0, 1, 2 internally.
In this case, you end up with two elements with the same HTML id (my-checkbox-1-field) which is very bad for both accessibility and automated E2E testing.
I'd be interested in hearing:
- if this is something that should be handled
- if so, how we should implement this?