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

fix(accordion): improve functionality with nested accordions #24302

Merged
merged 5 commits into from
Dec 6, 2021
Merged

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Dec 1, 2021

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number see internal ticket and https://twitter.com/schlimmson/status/1466015536253480960

The global accordion styles are too general and result in nested accordion groups getting impacts by the state of a parent accordion group. For example, if a parent accordion group is expanded, the icons in a nested accordion group will all be in the expanded state, even if the accordions themselves are not expanded

There was also an issue with keyboard navigation where you could jump between accordion groups by pressing the arrow keys.

What is the new behavior?

  • Styles targeting icons only apply to the direct descendant in the "header" slot.
  • Styles targeting accordions only target direct descendants of accordion groups
  • Arrow keys now stay within a single accordion group. To jump to the next/prev group users can use Tab or Shift + Tab
  • I also moved some spec tests to E2E due to limitations in Sizzle, a library stencil uses under the hood. Sizzle does not support :scope so it was causing errors when the new query selector got run.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the package: core @ionic/core package label Dec 1, 2021
Copy link
Contributor

@averyjohnston averyjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting disabled on the parent accordion group causes the whole thing (including the inner group) to look disabled, but the inner group can still be interacted with. Is that intentional? It feels like the inner group should be disabled too, but I'm open to other thoughts 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants