You are absolutely right! As I said, there are many more optimizations and this was by no means, an exhaustive guide on accessibility. It was merely just a couple tips that I picked up. The context tip is great and would be a great addition to this article.
With that being said HTML has a button element which by default receives keyboard focus, will trigger the click event with the enter key and is announced as a button. If you changed your div to the button you wouldn't need to write additional code to make it accessible.
This is also correct. The reason I wrote this article was because many React developers simply can't (or don't want) to use button in all cases. If you work in React land enough, you sometimes hit weird cases where proper semantic html elements and events cause strangeness in conjunction with the event loop of React.
In my experience with Angular and React training, developers don't use proper markup because the sources they learn from don't use proper markup. This is not a slight at any group of developers, simply an observation from the sources I've learned from.
Accessibility has long been an ignored part of development. I feel like accessibility is finally starting to get its due like web standards did 13+ years back.
It is articles like yours that help push the idea of accessibility into other developers minds. While I'll still push for the use of semantic and accessible HTML by default over adding in fixes, this article has taken something totally inaccessible and made it more accessible. That is an enormous win for those that need it.
Keep on writing the good code. Lets go Os.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You are absolutely right! As I said, there are many more optimizations and this was by no means, an exhaustive guide on accessibility. It was merely just a couple tips that I picked up. The context tip is great and would be a great addition to this article.
This is also correct. The reason I wrote this article was because many React developers simply can't (or don't want) to use
button
in all cases. If you work in React land enough, you sometimes hit weird cases where proper semantic html elements and events cause strangeness in conjunction with the event loop of React.In my experience with Angular and React training, developers don't use proper markup because the sources they learn from don't use proper markup. This is not a slight at any group of developers, simply an observation from the sources I've learned from.
Accessibility has long been an ignored part of development. I feel like accessibility is finally starting to get its due like web standards did 13+ years back.
It is articles like yours that help push the idea of accessibility into other developers minds. While I'll still push for the use of semantic and accessible HTML by default over adding in fixes, this article has taken something totally inaccessible and made it more accessible. That is an enormous win for those that need it.
Keep on writing the good code. Lets go Os.