react-code-input icon indicating copy to clipboard operation
react-code-input copied to clipboard

Fields have no labels

Open calumgunn opened this issue 4 years ago • 1 comments

Hi!

As per Deque University's accessibility rules, all inputs must have some form of label to pass basic a11y testing. See here: https://dequeuniversity.com/rules/axe/3.5/label?application=axeAPI

I'm working on a project that has quite stringent accessibility rules, and while react-code-input is working perfectly, it fails on this count.

I'd propose adding an optional label prop, which would add an aria-label attribute to each input, with the index appended.

Let me know if I can submit a PR for that, or any thoughts on this topic! Thanks :)

calumgunn avatar Jun 08 '20 13:06 calumgunn

While they apply such a change, you can resolve it by wrapping the input with a

<label style={{ ...yourStyles, color: transparent }}> Label text <ReactCodeInput {...props} /> </label>

FedericoLeiva12 avatar Jun 18 '21 14:06 FedericoLeiva12