Re: Aria roles

The worst, and most common, result of repurposing elements for some other
purpose happens in all those JavaScript frameworks and libraries, and many
developers too, that custom build all their interactive components using
the <div> element. Sometimes they will add an ARIA role with the vague idea
that this will somehow magically make it right! They just don't understand
that such custom components are useless to keyboard users. About 50% of all
websites I receive for auditing fail on repurposed divs.

Even when they try to add the interactivity, this always involves acres of
long JavaScript functions, with huge potential for getting it wrong. They
either don't properly understand exactly what keyboard interactivity they
should give a component (for instance that buttons should also work with
the spacebar), or they forget the edge cases. Or their efforts fail to work
with touch screen mobiles. It is so much easier to forget ARIA roles. where
the correct HTML element exists, and it is guaranteed to work correctly
straight out of the box.

Received on Wednesday, 7 April 2021 17:27:23 UTC