4 ms·
I'm not sure why the article mentions accessibility as a downside to this approach. If you use details/summary, it probably has some default behavior in screen
by lucasmullens 6y ago
I'm not sure why the article mentions accessibility as a downside to this approach. If you use details/summary, it probably has some default behavior in screen readers to explain that it's collapsable. The alternative of using some show/hide element with an onClick handler probably doesn't work as well for screen readers without a bunch of aria tags.
- xg15 6y agoIt breaks the intended semantics of the <details> and <summary> elements though: A post is not a summary of its replies. So screen readers which rely on these semantics could cause confusing behaviour.
- galoisgirl 6y ago> it probably has some default behavior in screen readers to explain that it's collapsable. Yes, and it reads leaves as collapsed, the user expands them and there's nothing there. That's confusing. > The alternative of using some show/hide element with an onClick handler probably doesn't work as well for screen readers without a bunch of aria tags. Yeah, `aria-expanded` (you need an expanded CSS class anyway) and maybe `aria-owns`. Titanic work. The cool thing about accessibility is that you have to think a lot less. You just open https://www.w3.org/TR/wai-aria-practices-1.1 https://www.w3.org/TR/wai-aria-practices-1.1 , find the widget or scenario you need and do as they say. Win-win.
- lucasmullens 6y agoWhat do you mean by "the user expands them and there's nothing there"?