mysociety / jquery-multi-select

Converts <select multiple> elements into dropdown menus with checkboxes
https://www.mysociety.org/
Other
24 stars 18 forks source link

Maintain the label for link but hide the label instead #38

Open dracos opened 1 year ago

dracos commented 1 year ago

30 removed the for from the label. A further accessibility audit with a user who disabled all CSS but had JS enabled raised the issue that we then had an input with no matching label... I think the solution that fixes this but maintains the previous thing being solved also is therefore to revert #30, and instead create a copy of the label, and hide the label with the for. So it matches the item's behaviour.

zarino commented 1 year ago

Sounds sensible to me!

We’ll also want to make sure that the current click handler we have assigned to the real label (to toggle the menu) is added to the "fake" label instead.

dracos commented 1 month ago

To note our current behaviour: https://github.com/mysociety/fixmystreet/blob/9c9053065fd7692cc904bf4130fa51e1fd37aafd/web/cobrands/fixmystreet/fixmystreet.js#L1110 - we do as above, put the for back in and hide the label, and add a span