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 template renders radio field inputs with same id #156
Is there a reason we are even setting id on these inputs? You should be able to target them in tests based on index position (since you control the data you know what index you want. In JS, it would be just as easy to target based on name or value attributes. Actually, you can do the same with PyQuery.
FWIW, I try to avoid using IDs for anything unless really needed due to the issue of accidental duplication.
I don't like just using lower b/c you could have characters in a value that aren't valid in the id attribute. I'd suggest using blazeutils simplify instead as the filter.
My preferences would be:
Remove id attribute and you no longer need to worry about it being accidentally duplicated
Activity
bchopson commentedon Sep 13, 2021
perhaps
id="{{ field.id }}-{{ field.value }}"rsyring commentedon Sep 15, 2021
Is there a reason we are even setting id on these inputs? You should be able to target them in tests based on index position (since you control the data you know what index you want. In JS, it would be just as easy to target based on
nameorvalueattributes. Actually, you can do the same with PyQuery.FWIW, I try to avoid using IDs for anything unless really needed due to the issue of accidental duplication.
I don't like just using
lowerb/c you could have characters in a value that aren't valid in theidattribute. I'd suggest using blazeutilssimplifyinstead as the filter.My preferences would be:
simplifyon the value instead oflower./cc @matthiaswh, @guruofgentoo, @bchopson to weigh in.
bchopson commentedon Sep 16, 2021
I believe the id for inputs is so that a
<label>can reference that input via itsforattribute. Settingforexplicitly is helpful for screen readers.resolve radio ID duplication and error display in Bootstrap 4