react-accordion - Adds id control for AccordionHeader and AccordionPanel#17547
react-accordion - Adds id control for AccordionHeader and AccordionPanel#17547bsunderhus merged 3 commits intomasterfrom
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8498790:
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: f6fdb8a4774489c354e7b0fbaec37485ffe7920b (build) |
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Perf comparison
Perf tests with no regressions
|
| const expandIconPosition = useContextSelector(accordionContext, ctx => ctx.expandIconPosition); | ||
| const size = useContextSelector(accordionContext, ctx => ctx.size); | ||
| const id = useId('accordion-header-', props.id); | ||
| const panel = useDescendants(accordionItemDescendantContext)[1] as AccordionItemDescendant | undefined; |
There was a problem hiding this comment.
You could encapsulate the usages of useDescendants with smth like useAccordionHeaderDescendant, I think it adds to some nicer readability, but it's definitely a nit
|
🎉 Handy links: |
|
🎉 Handy links: |
…nel (microsoft#17547) * Adds id control for AccordionHeader and AccordionPanel * Updates tests * Change files
…nel (microsoft#17547) * Adds id control for AccordionHeader and AccordionPanel * Updates tests * Change files
Pull request checklist
$ yarn changeDescription of changes
A common problem on Compound Components is sharing
idinformation between siblings to ensure a11y. This PR introduces a simple usage of the descendants API to solve that.