jQuery-Selectric icon indicating copy to clipboard operation
jQuery-Selectric copied to clipboard

Add label to hidden input for accessibility

Open stephenmcghee opened this issue 9 years ago • 2 comments

When I run my accessibility checker, Selectric fails because it is missing a form <label> for the hidden input Selectric creates. Is there a way you can add a hidden <label> to accompany the hidden input? See Image attached.

selectric-label-accessibility

Thanks

stephenmcghee avatar Jul 20 '17 19:07 stephenmcghee

I've coded a temporary fix for this: //Add a hidden label around the selectric input for accessibility. $(".selectric-input").wrap("<label class='VisuallyHidden' aria-hidden='true'>Hidden Label</label>");

Where the class VisuallyHidden is similar to the selectric-input class in hiding the label.

stephenmcghee avatar Jul 25 '17 20:07 stephenmcghee

Works for me... .... onInit: function(element) { $(element).closest('.selectric-wrapper').find('.selectric-input').attr('id', element[0].text); }, ....

hh-com avatar Jun 21 '23 09:06 hh-com