fac24 / Week-4-Sonia-Peter-George-Petra

COCORICO 🧀
http://cocorico.herokuapp.com
2 stars 1 forks source link

Don't duplicate labels with aria-label #24

Open oliverjam opened 2 years ago

oliverjam commented 2 years ago

https://github.com/fac24/Week-4-Sonia-Peter-George-Petra/blob/2a6d20f1f892f6e38d1fdb1ba4c3df2cef3dd8bb/routes/addPost.js#L11-L12 https://github.com/fac24/Week-4-Sonia-Peter-George-Petra/blob/2a6d20f1f892f6e38d1fdb1ba4c3df2cef3dd8bb/routes/addPost.js#L24

Your inputs/buttons appear to have visible labels, so you don't really need to add aria-labels as well. This will just end up confusing for sighted screen reader users, as they will see one thing and hear another.

The only time you might want to do this is if there were some additional context required to use a complex UI that was obvious visually but maybe not aurally.

Also make sure you don't put unnecessary info in an aria-label. I.e. for an input the user already knows that have to enter a value, that's what inputs are for. So you don't need to put that instruction in the label. The same goes for buttons—users know they can click them so you don't need to tell them to do that in the label.