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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webbykat’s picture

Issue summary: View changes
webbykat’s picture

Issue summary: View changes
mgifford’s picture

mikeker’s picture

Status: Active » Closed (works as designed)

Issue 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.

Melissamcewen’s picture

Hi 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

Melissamcewen’s picture

Status: Closed (works as designed) » Needs review
mgifford’s picture

I 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.

kthull’s picture

#5 worked for me.

Neslee Canil Pinto’s picture

Status: Needs review » Closed (won't fix)

Hi, 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).