Releases: springload/react-accessible-accordion
v3.0.1
v3.0.0
This release is the culmination of a massive amount of work, resulting in some
new features and significantly stronger and more reliable WAI ARIA spec
compliance. Notably, the project has been migrated from Flow to Typescript, and
a full accessibility audit has been performed - revealing a few holes in our
compliance which have now been entirely addressed.
Thanks to everyone who has contributed to this release - and not just those who
have written code. Contribution by way of issues relating to spec compliance,
pull-request commentary, advice and assistance is all greatly appreciated.
Thanks also to the patient users who have endured an extended period without a
release while we made sure to get this 100% right! Release cadence should return
to normal again now.
Breaking Changes - Upgrade Guide:
-
Rename all of your
AccordionItemTitle
components toAccordionItemHeading
and then nest anAccordionItemButton
directly inside of each one. Note that
in order for your Accordion to remain spec-compliant, you may not put any
other children insideAccordionItemHeading
.// Before: import { AccordionItemTitle } from 'react-accessible-accordion'; const headingBefore = <AccordionItemTitle>Foo</AccordionItemTitle>;
// After: import { AcccordionItemHeading, AccordionItemButton, } from 'react-accessible-accordion'; const headingAfter = ( <AccordionItemHeading> <AccordionItemButton>Foo</AccordionItemButton> </AccordionItemHeading> );
-
Rename all of your
AccordionItemBody
components toAccordionItemPanel
.// Before: import { AccordionItemBody } from 'react-accessible-accordion'; const panelBefore = ( <AccordionItemBody> Voluptate elit eiusmod laborum proident esse officia dolor laboris laboris amet nulla officia cillum. </AccordionItemBody> );
// After: import { AccordionItemPanel } from 'react-accessible-accordion'; const panelAfter = ( <AccordionItemPanel> Voluptate elit eiusmod laborum proident esse officia dolor laboris laboris amet nulla officia cillum. </AccordionItemPanel> );
-
Remove all instances of
hideBodyClassName
. This prop is no longer valid, as
AccordionItemPanel
components are now hidden without additional styling. If
you must have a differentclassName
prop when an item is collapsed, then
you may leverage the newAccordionItemState
component.// Before import { AccordionItemPanel } from 'react-accessible-accordion'; const panelBefore = ( <AccordionItemPanel className="foo" hideBodyClassName="foo--hidden" /> );
// After: import { AccordionItemPanel, AccordionItemState, } from 'react-accessible-accordion'; const panelAfter = ( <AccordionItemState> {({ expanded }) => ( <AccordionItemPanel className={expanded ? 'foo' : 'foo foo--hidden'} /> )} </AccordionItemState> );
-
Remove all instances of
AccordionItem
’sexpanded
prop and instead use
Accordion
’spreExpanded
prop. Note that this means that ‘controlled’
accordions are no longer a supported pattern. Please raise an issue if you
have a use-case which calls for the ability to manually control expanded
state.// Before import { Accordion, AccordionItem } from 'react-accessible-accordion'; const accordionBefore = ( <Accordion> <AccordionItem expanded /> </Accordion> );
// After: import { Accordion, AccordionItem } from 'react-accessible-accordion'; const accordionAfter = ( <Accordion preExpanded={['foo']}> <AccordionItem uuid="foo" /> </Accordion> );
-
Remove all instances of
Accordion
’saccordion
prop. Instead, use a
combination ofallowZeroExpanded
andallowMultipleExpanded
props to suit
your requirements. If you were not explicitly settingaccordion
tofalse
then you probably are not required to make any changes here.// Before import { Accordion } from 'react-accessible-accordion'; const accordionBefore = <Accordion accordion={false} />;
// After: import { Accordion } from 'react-accessible-accordion'; const accordionAfter = <Accordion allowMultipleExpanded />;
-
Upgrade to React v16.3+
-
Remove your
minimal-example.css
import. These styles only applied
display: none
to panels when collapsed, but browsers apply these styles to
elements with thehidden
attribute, which theAccordionItemPanel
component now has (when collapsed).
Added
- Added
AccordionItemButton
component. - Added
AccordionItemState
component. - Added
allowZeroExpanded
prop toAccordion
. - Added
allowMultipleExpanded
prop toAccordion
. - Out-of-the-box Typescript support.
- Integration tests to explicitly assert every line of the WAI ARIA
'Accordion' spec. - Additional keyboard functionality (Up, Down, Left, Right, Home, End).
Changed
- Renamed
AccordionItemTitle
toAccordionItemHeading
to be consistent with
the language used in the WAI ARIA spec. - Renamed
AccordionItemBody
toAccordionItemPanel
to be consistent with
the language used in the WAI ARIA spec. - Updated
AccordionItemPanel
to have ahidden
attribute. - Roles and aria attributes all audited and updated to match the WAI ARIA
spec. - Update
onChange
to always be called with an array of the currently
expanded items.
Fixed
- Fixes SSR (server-side rendering).
- Fixes incorrect roles and attributes as per the WAI ARIA spec.
Removed
- Removed Flow support (but we hope to reinstate typing in the future. Track
progress
here). - Removed undocumented
expanded
mechanism forAccordionItems
. - Removed undocumented
disabled
mechanism forAccordionItems
. - Remove
hideBodyClassName
prop.
v2.4.5
v2.4.4
This release addresses some performance concerns, and should result in lower memory usage and prevented crashes.
Fixed
- Fixes performance issue with not re-instantiating render-prop callbacks on each re-render.
v2.4.4-beta.1
2.4.4-beta.1
v2.4.2
Changed
- Removes invalid test
- Minor change to package.json to remove some redundant Jest config.
- Upgrade one forgotten devDependency.
Fixed
- Emergency bug fix to remove asyc/await from the code (see PR#95)
v2.4.1
This release brings support for React 16.3+ by way of some minor refactoring to remove deprecated lifecycle methods.
Changed
- Replace deprecated lifecycle methods 'componentWillReceiveProps', 'componentWillUpdate' and 'componentWillMount'.
- Updated
unstated
(internal dependency) to latest major release. - Updated all devDependencies.
v2.4.0
Added
- Possibility to have custom uuid on
AccordionItem
- suggested by #70
Fixed
- Fix rollup config after version bump - https://gist.github.com/Rich-Harris/d472c50732dab03efeb37472b08a3f32
- Adds existing arrow animation for aria-selected=true in fancy CSS
v2.3.1
Fixed
- Add
dist
folder to list of Flow ignores, so Flow doesn’t error after a build. - Issue with babel helpers. Just reverted commit 6f9f2c3 for now.
Changed
- Removed a couple of old npm scripts from the days before we introduced rollup to the build
pipeline. - Upgraded a bunch of devDependencies, including Webpack which required a bit of a config refactor.
v2.3.0
Changed
- Refactored to use
unstated
for state-management instead ofmobx
+mobx-react
, cutting the
size of the bundle by approximately 60% 🎉.