WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: aria-disabled is really required

for

From: glen walker
Date: Mar 13, 2018 11:15AM


> So to clarify, setting €œaria-disabled for element not supporting
disabled is enough i.e. we don't have to do anything to the tabindex as
screen readers indicate that they are disabled?

Not exactly. Aria-disabled will cause the SR to say the element is
disabled, but like all other ARIA attributes, it does *not* change
behavior. If you have to set aria-disabled on a custom element, and that
element is focusable because you have tabindex=0, then setting
aria-disabled will not automatically remove that element from the tab
order. You have to do it yourself because you have a custom element.

For elements that natively support the disabled property (<input>,
<button>, etc), then all that is taken care of for you.

Same with the visuals of a disabled element. Native elements will
automatically look different when disabled but setting aria-disabled on
your custom element will not change its appearance. You'd need a class
like:

.myClass {
/* normal styling */
}
.myClass[aria-disabled="true"] {
/* stuff to make element look disabled */
}