Skip to content

Commit

Permalink
chore(accordion-item): add more info about accordion item sync (#7473)
Browse files Browse the repository at this point in the history
**Related Issue:**
#7466 (comment)

## Summary

✨📚✨
  • Loading branch information
jcfranco authored Aug 7, 2023
1 parent 633c2cd commit 18022ce
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,13 @@ export class AccordionItem implements ConditionalSlotComponent {
}

@Listen("calciteInternalAccordionItemsSync", { target: "document" })
updateAccordionChildSync(event: CustomEvent): void {
accordionItemSyncHandler(event: CustomEvent): void {
const [accordion] = event.composedPath();
const accordionItem = this.el;

// we sync with our accordion parent via event only if the item is wrapped within another component's shadow DOM,
// otherwise, the accordion parent will sync the item directly

const willBeSyncedByDirectParent = accordionItem.parentElement === accordion;
if (willBeSyncedByDirectParent) {
return;
Expand Down

0 comments on commit 18022ce

Please sign in to comment.