BEF offers collapsible fieldset options for checkboxes and radio buttons. By default, there is no collapsible fieldset. If you don't use a collapsible fieldset, then you end up with an orphaned label.
Example/reproduction:
Let's say your exposed filter options are a content type list:
Type
- Event
- Press Release
- Video
Event, Press Release, and Video will get both an input (a checkbox or radio button) and a label (the words "Event," "Press Release," "Video," etc.). But Type itself is also identified as a label. Since you chose not to have a fieldset -- because you didn't want it to be collapsible -- Type will still be a label, but it won't be associated with anything. This gets flagged as an error for any sites that run scans to ensure Section 508 compliance, which affects a decent chunk of government clients.
If you do choose to have a fieldset, the fieldset will wrap around your checkbox list and Type will get associated with it properly.
Both behaviors can be validated with the WAVE toolbar for Firefox.
I'd recommend resolving this by offering both a "Make this a fieldset" option and a "Make the fieldset collapsible" option, instead of making every fieldset be collapsible. That way, site builders can choose whether or not they want the collapsible feature but labels will never be orphaned.
Our team may take a crack at a patch next week.
Comment | File | Size | Author |
---|---|---|---|
#5 | fieldset-2145487-5.patch | 6.87 KB | Melissamcewen |
Comments
Comment #1
webbykat CreditAttribution: webbykat commentedComment #2
webbykat CreditAttribution: webbykat commentedComment #3
mgiffordI think this is an issue with Core. #504962: Provide a compound form element with accessible labels
Also worth looking at #945438: Prevent label @for from pointing at non-existent @id
Comment #4
mikeker CreditAttribution: mikeker commentedIssue queue cleanup... Sorry for not getting to this one earlier!
Based on #3, I'm closing this as by design (or, rather, by core design). Please reopen with specific on how to reproduce this issue if you're still having this problem.
Thanks.
Comment #5
Melissamcewen CreditAttribution: Melissamcewen as a volunteer commentedHi all, I encountered this issue working with a government site that needed to follow the HTML5 and ARIA Techniques ruleset. Here is a patch that introduces the ability to select having your filters in a fieldset without collapsibility. The rule is "Each label element using the for attribute must reference a form control on the page."
https://www.w3.org/TR/WCAG20/#minimize-error-cues
Comment #6
Melissamcewen CreditAttribution: Melissamcewen as a volunteer commentedComment #7
mgiffordI should have noted that just because there is an issue with this in Core, doesn't mean it shouldn't' be fixed in Conrib
Thanks for this @Melissamcewen and hopefully we get it in Better Exposed Filters.
Comment #8
kthull#5 worked for me.
Comment #9
Neslee Canil PintoHi, there will be no more future development for 7.x branch. If you see this issue in 8.x, feel free to file an issue. Closing this as Closed(wont fix).