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

Accordion: add example which includes an extra button #1471

Open
jnurthen opened this issue Jul 27, 2020 · 2 comments
Open

Accordion: add example which includes an extra button #1471

jnurthen opened this issue Jul 27, 2020 · 2 comments
Labels
enhancement Any addition or improvement that doesn't fix a code bug or prose inaccuracy Example Page Related to a page containing an example implementation of a pattern

Comments

@jnurthen
Copy link
Member

the accordion pattern states

In some accordions, there are additional elements that are always visible adjacent to the accordion header. For instance, a menubutton may accompany each accordion header to provide access to actions that apply to that section. And, in some cases, a snippet of the hidden content may also be visually persistent.

There should be an example explaining where in the DOM structure this content should be placed. My assumption is that it should be between the header/expand button and the accordion content but outside the header element.

@carmacleod
Copy link
Contributor

Good idea for an example. It should also allow all panels to be closed or open, i.e. the current example enforces precisely one panel at a time (which has a bit of an awkward feel, particularly with that disabled button in there), so need to show an alternative to that.

Regarding where to put the overflow menubutton, I wonder if (since HTML headings allow button content and since heading role allows name from content or author), it could conceivably go inside the header as a sibling of the expand/collapse button? (of course, we would need to try both ways - button-after-heading and button-in-heading - with screen readers to see which one has better support and make sure the buttons don't get "flattened" into the heading's name. May need to provide a name from author). Anyhow, just a thought.

@carmacleod
Copy link
Contributor

Ok, so allowing all panels to be closed or open (and even providing a UI method to expand all/collapse all) has already been asked for multiple times: #616 and #304 (comment).
In fact, apparently the current example even has flags that can be modified by editing the javascript (allowToggle and allowMultiple), which is totally un-obvious and needs to be surfaced in the example UI.

Nonetheless, I feel that any new accordion example needs to allow all panels to open and close by default (no flags).

@mcking65 mcking65 added enhancement Any addition or improvement that doesn't fix a code bug or prose inaccuracy Example Page Related to a page containing an example implementation of a pattern labels Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any addition or improvement that doesn't fix a code bug or prose inaccuracy Example Page Related to a page containing an example implementation of a pattern
Development

No branches or pull requests

3 participants