-
Notifications
You must be signed in to change notification settings - Fork 83
feat(accordion): update to use correct HTML semantics #7272
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
Conversation
f892ec8
to
7151102
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good work @damienrobson-sage, it's great to now be able to use the semantically correct elements now. I notice when I've run the chromatic build there that some of the component is rendering slightly off screen, not sure if that'll affect chromatic but it does when viewing the docs etc. I also notice there's a tests
story not sure if that's intentional.
src/components/accordion/accordion-group/accordion-group.component.tsx
Outdated
Show resolved
Hide resolved
src/components/tile-select/__internal__/accordion/accordion.style.ts
Outdated
Show resolved
Hide resolved
e4b66eb
to
563f57b
Compare
d2d80ce
to
7864b25
Compare
7864b25
to
0a15312
Compare
e16414a
to
92dea15
Compare
@damienrobson-sage looking into this, as it seems the way the content appears has changed so need to be sure this wont cause issues with larger content from an accoridon |
@harpalsingh spun up a quick test of the component with 10 paragraphs worth of lorem ipsum (see below). Is this what you were wanting to check? |
f38b506
BREAKING CHANGE: The `Accordion` component has been re-written to use the correct HTML semantics (details and summary). As a result, the `defaultExpanded` prop has been removed; please use the `expanded` prop in it's place.
93a9373
to
d9f36bd
Compare
BREAKING CHANGE:
Accordion
has been rewritten to use the correct HTML semantics (details
andsummary
). As such,defaultExpanded
has been deprecated in favour ofexpanded
. TheAccordionGroup
component has also been removed.Proposed behaviour
Accordion
using the semantically-correctdetails
andsummary
elements, whilst maintaining functionality.AccordionGroup
.Current behaviour
The current implementation of
Accordion
is built withdiv
elements as opposed to the semantically-correctdetails
andsummary
elements. This is due to legacy constraints wherebydetails
/summary
could not be animated.Checklist
d.ts
file added or updated if requiredQA
Additional context
Accordion
elements inAccordionGroup
has been removed. The default behaviour of tabbing between components should be used instead;groupName
prop as well as via theAccordionGroup
component. Using the component approach, accordions will retain their open/closed state when other accordions are opened. Using the semantic approach, only one accordion can be open in a group at any given time;Testing instructions
Use the updated Storybook examples to test the new functionalities.