Cds-Accordion event for Collapse and Expand #6734
-
Hi All, Note I am using expandedChange event also I not able to find the panel id or number. Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The Here's more info on Javascript event targets. And here is an example of how those work with the accordion panel's The code here is looking for an event target with an id of ...and here is the accordion panel with |
Beta Was this translation helpful? Give feedback.
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 atarget
. The target of theexpandedChange
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=…