Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
268 stars 75 forks source link

Public events for accordion, accordion-item #4531

Open jgibson02 opened 2 years ago

jgibson02 commented 2 years ago

Description

To support programmatically focusing certain, there should be public events to notify when accordion-items are opened/closed.

Acceptance Criteria

Relevant Info

No response

Which Component

accordion, accordion-item

Example Use Case

In forms with several complex sections, there may be need to programmatically set the active prop of an accordion-item, e.g. to prompt the user for a required form control. If you had a piece of state with a boolean that was setting this active prop, then you would need to listen for when the user clicks on an accordion-item. You can currently (at least with the React wrapper) add an onClick event, but this would also fire when clicking anywhere inside the accordion-item's content.

image
ReneU commented 2 years ago

+1 this would also be helpful for our migration as we hide some 'expensive' components (such as the ArcGIS JS API) initially and only lazy load the content when the user opens the accordion item: image

jcfranco commented 1 month ago

Public events for accordion-item for open & close

This is blocked by https://github.com/Esri/calcite-design-system/issues/6473. cc @geospatialem