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

Add accordion example that allows all panels to be collapsed #304

Closed
DavidMacDonald opened this issue Feb 22, 2017 · 7 comments · Fixed by #1830
Closed

Add accordion example that allows all panels to be collapsed #304

DavidMacDonald opened this issue Feb 22, 2017 · 7 comments · Fixed by #1830
Assignees
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 Feedback Issue raised by or for collecting input from people outside APG task force
Milestone

Comments

@DavidMacDonald
Copy link

I like the accordion example but there is no way to close all.

@ZoeBijl
Copy link
Contributor

ZoeBijl commented Feb 22, 2017

Yes, yes, yes! You should totally be able to close all panels, it’s so annoying that you can’t.

@pauljadam
Copy link

what about an example where the accordion can close completely? I keep clicking to close the last open panel but it won't.

@ZoeBijl ZoeBijl added the Feedback Issue raised by or for collecting input from people outside APG task force label Feb 22, 2017
@DavidMacDonald
Copy link
Author

It should have a way to open all panels too... I think most users who are blind would like to be able to open the whole thing from the beginning.

@ZoeBijl
Copy link
Contributor

ZoeBijl commented Feb 22, 2017

@DavidMacDonald I think that is what the disclosure design pattern is for. That does exactly what you describe.

@jnurthen
Copy link
Member

Accordions come in all sorts of types.

  • Some allow all panels to be collapsed
  • Some will collapse a previous panel when another is opened
  • Some allow multiple panels to be expanded.

I don't want to mandate one pattern over another as in different circumstances different ones are appropriate.

Bryan's JS has a simple way to modify these - look in setup.js

// Allow for each toggle to both open and close individually
var allowToggle = false,
// Allow for multiple accordion sections to be expanded at the same time
allowMultiple = false;

@mcking65 mcking65 self-assigned this Mar 9, 2017
@mcking65 mcking65 added this to the Jan 2017 Clean Up milestone Mar 9, 2017
@mcking65 mcking65 added the Example Page Related to a page containing an example implementation of a pattern label Mar 9, 2017
@mcking65 mcking65 modified the milestones: 1.1 PR, Jan 2017 Clean Up Mar 9, 2017
@mcking65 mcking65 added the enhancement Any addition or improvement that doesn't fix a code bug or prose inaccuracy label Mar 9, 2017
@mcking65 mcking65 changed the title I think accordions should have a control to expand and collapse all Add accordion example that allows all panels to be collapsed Mar 9, 2017
@mcking65
Copy link
Contributor

mcking65 commented Mar 9, 2017

As @jnurthen pointed out, the code for the accordion example is configurable. That does mean that it would be a simple change for us to create a different behavior on the current example page. Alternatively, we could easily have two configurations.

Showing only one configuration implies a preference.

I have read some research that suggests that forcing one panel to always be open has negative impact on UX ... I'll see if I can dig that up. That would be another reason for adding a page with an alternative configuration.

If we do add an example where all panels can be collapsed, then we may want to consider adding a button for expand/collapse all.

@DavidMacDonald
Copy link
Author

@mcking65

If we do add an example where all panels can be collapsed, then we may want to consider adding a button for expand/collapse all.

Yes, by all means... I think the accordion should have expand all and collapse all... buttons (or toggle)

@mcking65 mcking65 removed this from the 1.1 APG Release 4 milestone Aug 13, 2019
@mcking65 mcking65 added this to the 1.2 Release 1 milestone Oct 4, 2021
@mcking65 mcking65 linked a pull request Oct 4, 2021 that will close this issue
6 tasks
mcking65 pushed a commit that referenced this issue Oct 4, 2021
…es, implement APG code guidelines (pull #1830)

Updates the accordion example to resolve issues #1819, #616, #304, and #1477.

Made the following Behavior changes:
* Removed optional arrow key support.
* Removed requirement forcing one section to always be expanded.
* Removed constraint limiting only one section to be expanded at a time.
* Updated tests to reflect behavior changes.
* Removed section that talked about focus styling for "enhanced keyboard interaction".
* Removed arrow key/home/end rows in example page keyboard table.
* Removed aria-disabled row in example page attributes table.

Code cleanup:
* Updated JS file to a class syntax.
* Update classnames to be lowercase.
* Fix some border-radius issues in focus styling.
* Updated example page wrapper id  attributes to match other example pages.
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 Feedback Issue raised by or for collecting input from people outside APG task force
Development

Successfully merging a pull request may close this issue.

5 participants