Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding an expandable "region" #3215

Open
scottaohara opened this issue Jan 16, 2025 · 1 comment
Open

Consider adding an expandable "region" #3215

scottaohara opened this issue Jan 16, 2025 · 1 comment

Comments

@scottaohara
Copy link
Member

From the ARIA WG call today, we talked about a clickable "region / card / section of content" that expanded/collapsed to reveal more or less content.

The context being that Aaron was discussing a use case where the parent element was a button that expanded and collapsed, and complex content was nested within this button, rather than as a sibling to it, and this being a use case as to why child presentation was removed from button roles in chrome/firefox.

Rather than repeat that discussion here - it was mentioned that we could come with a pattern to sort of replicate this use case, but without needing to nest the content within a button - but still making the card/content/region/whatever fully clickable to expand/collapse.

For instance, design an expanding/collapsing card component where there's an icon (plus / minus) in one of the corners to serve as the actual button - and use javascript to otherwise make the entire card clickable / change the state of the button.

@scottaohara
Copy link
Member Author

a quick example of how i interpreted the component being discussed today - built in a way where the content does not need to be nested within a button - but the whole block/card is still clickable

https://codepen.io/scottohara/pen/ZYzRVmg

instance 1 has a visible button to show/hide the content that is hidden via inert in the default state.

instance 2 is the same markup structure, but with the button visually hidden.

both instances have a focus indicator around the entire card that appears when the button within each instance is focused - so even instance 2 not having a visible button, there is still a focus indicator that appears for the 'card'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant