File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,8 @@ Allow the only remaining expanded item to be collapsed.
9797
9898#### preExpanded: ` string[]` [_optional_, default: ` []` ]
9999
100- Accepts an array of strings and any ` AccordionItem` whose ` uuid` prop matches any one
101- of these strings will be expanded on mount.
100+ Accepts an array of strings and any ` AccordionItem` whose ` uuid` prop matches
101+ any one of these strings will be expanded on mount.
102102
103103#### className : ` string` [*optional*, default: ` ' accordion' ` ]
104104
@@ -121,6 +121,12 @@ Class(es) to apply to element.
121121
122122Recommended for use with ` onChange` . Will be auto-generated if not provided.
123123
124+ #### dangerouslySetExpanding: ` boolean` [*optional*]
125+
126+ Enables external control of the expansion.
127+
128+ > Warning: This may impact accessibility negatively, use at your own risk
129+
124130---
125131
126132### AccordionItemHeading
Original file line number Diff line number Diff line change @@ -209,13 +209,14 @@ const App = (): JSX.Element => (
209209
210210 < Accordion >
211211 { placeholders . map ( ( placeholder : Placeholder , i : number ) => {
212- const dangerouslySetExpanded = i < 2 ? true : false ;
212+ const isExpanded = i < 2 ;
213213
214214 return (
215215 < AccordionItem
216216 key = { placeholder . heading }
217217 uuid = { placeholder . uuid }
218- dangerouslySetExpanded = { dangerouslySetExpanded }
218+ // Warning: This can impact accessibility negatively
219+ dangerouslySetExpanded = { isExpanded }
219220 >
220221 < AccordionItemHeading >
221222 < AccordionItemButton >
You can’t perform that action at this time.
0 commit comments