The multiselect element output by this module does not have a title and therefore does not have a <label> in the HTML. It should have one (at least for screen reader users); in most cases we probably don't need a visible title because it will be displayed inside a facet block and the block has a title of its own which is sufficient.
The problem is that it's a generic form element and it's not clear what the title should be...
We could add something generic (and indicate in the README.txt that people should override it), or try to figure out how to do something better than that.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | facetapi_multiselect-form_label-1810278-3.patch | 1.17 KB | BarisW |
| #1 | facetapi_multiselect-form_label-1810278-1.patch | 908 bytes | tauno |
Comments
Comment #1
tauno commentedPatch adds a label using the facet's title (Filter by TITLE), similar to what the block title defaults to. The title is hidden by default (but readable by screen readers) using the FORM API.
Comment #2
mgiffordLooks good to me. Seems like a simple fix! Thanks for the re-roll @tauno
Comment #3
BarisW commentedGreat fix. Here's is the same patch, with a small addition. I've also added the same title value as 'data-placeholder', so they will be used when combined with Chosen. Implementations without Chosen, nothing changes.
Comment #4
firestonej commentedI think we should merge the fix in #1 with the work being done in 1806344, since the data-placeholder attribute should be adjustable as a facet option.
I'm not sure if the title label should also be customizable – seems more appropriate to me to keep that as the facet title itself. Thoughts?