Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Cds-Accordion event for Collapse and Expand #6734

Discussion options

You must be logged in to vote

Hi @KishanRavindran

The expandedChange event is a custom event but it is still a normal DOM event like you would see in vanilla Javascript. This means that all these events include a target. The target of the expandedChange events are the panels that are being open and closed.

Here's more info on Javascript event targets.

And here is an example of how those work with the accordion panel's expandedChange event from the Clarity Core documentation.

The code here is looking for an event target with an id of "async"...

https://github.com/vmware/clarity/blob/407e3c9307f00643d870d87338ecce0dc4833568/packages/core/src/accordion/accordion.stories.ts#L104

...and here is the accordion panel with id=…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KishanRavindran
Comment options

Answer selected by KishanRavindran
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants