Accessibility issue with modal close container

Description:

the a-element a.cc-mdl-close which is used to close modals results in this error message (see screenshot) because it seems to be focusable.

Screenshots, screen recording, code snippet

Environment info

  • WordPress version: latest
  • Cwicly Plugin version: latest

Hey @Jonas.

Hope that clears things a bit up:

1 Like

Hi @Marius,

thanks for the reference!
It seems I misunderstood the description. I thought the focusable element in question was the .cc-mdl-close-element. But it indeed refers to not existing elements inside of it.

So I just read about it and even though the Google lighthouse description only refers to elements inside also the element with aria-hidden="true" itself should not be focusable.

Meaning it should get the disabled attribute. See here: Axe Rules | Deque University | Deque Systems

A focusable element with aria-hidden="true" is ignored as part of the reading order, but still part of the focus order, making it’s state of visible or hidden unclear.

Hey @Jonas.

It’s not focusable because there is aria-hidden="true" in place which is sufficient.
It is not possible to focus the modal overlay.

Furthermore, the disabled attribute can’t be used for a tags.

This applies only for applicable elements, like input, as you can see in the example you posted.

Hi @Marius,

ok, this makes sense. Thanks a lot for your explanation!