nkbt/react-collapse

[A11Y] Add HTML tag "aria-hidden"

Closed this issue · 5 comments

For accessibility, collapse element should have an aria-hidden tag on the div.ReactCollapse--collapse

Cases: aria-hidden=

  • true collapse is closed
  • false collapse is opened
nkbt commented

Can it be set on a parent element?

It could be set on a parent element indeed, the fact that all the children is hidden when closed, it should work.

By the way, for accessibility, it will be better if div.ReactCollapse--collapse has visibility:hidden. It permits for accessibility tools to know that the element is out of view.

Thanks for your answer

nkbt commented

I agree, it's probably better to externalize it.

Finally, I used UnmountedClose. Better for accessibility that the component not appearing in DOM when is hidden.

Thanks

nkbt commented