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

Incorrect autofocus attribute

Open chris-verclytte opened this issue 6 years ago • 0 comments

Hi,

It seems to me that autoFocus prop sets incorrect state. Indeed, here you set autoFocus="autofocus" if autofocus prop is set, autofocus="" otherwise. However, in HTML 5, the presence of the attribute acts as a boolean, then both autoFocus="autofocus" and autoFocus="" has the same signification (see this Stack Overflow question).

On another hand, as specified in the MDN, autofocus is not a good practice for accessibility, then maybe it would be a better choice to set this attribute default to false ?

chris-verclytte avatar Oct 01 '18 09:10 chris-verclytte