calcite-design-system icon indicating copy to clipboard operation
calcite-design-system copied to clipboard

Add 'before' events for events that fire after a transition

Open jcfranco opened this issue 2 years ago • 3 comments

Description

We have some events that are emitted after a transition finishes (e.g., closing modal). Adding an event that fires before the transition kicks off would be a useful hook for developers.

Acceptance Criteria

  1. calcite<Component>Before<Event> events are added for transition-chained events.
  2. The conventions guidelines should be updated to describe this pattern

Relevant Info

No response

Which Component

  • calcite-alert
  • calcite-combobox
  • calcite-dropdown
  • calcite-input-date-picker
  • calcite-modal
  • calcite-popover

Each of the following has an open/close event.

Example Use Case

alert.addEventListener("calciteAlertBeforeOpen", () => { /* do something on the app or component side that needs to happen before the DOM is updated */});
alert.addEventListener("calciteAlertOpen", () => { /* do something with the updated DOM */});

jcfranco avatar Jun 05 '22 04:06 jcfranco

Installed and assigned for verification.

github-actions[bot] avatar Jul 29 '22 16:07 github-actions[bot]

This is looking really good, nice work Eliza!

The only issue I found is that calciteModalOpen and calciteModalBeforeOpen do not emit on page load like the rest of the components. However they do emit correctly when you close and reopen the modal. Here is a codepen with all of the affected components open on page load: https://codepen.io/benesri/pen/VwXXJBZ?editors=1111

I'm assigning this back to dev to get calciteModalOpen and calciteModalBeforeOpen to emit on page load when relevant, such as the codepen above.

benelan avatar Aug 04 '22 23:08 benelan

This is looking really good, nice work Eliza!

The only issue I found is that calciteModalOpen and calciteModalBeforeOpen do not emit on page load like the rest of the components. However they do emit correctly when you close and reopen the modal. Here is a codepen with all of the affected components open on page load: https://codepen.io/benesri/pen/VwXXJBZ?editors=1111

I'm assigning this back to dev to get calciteModalOpen and calciteModalBeforeOpen to emit on page load when relevant, such as the codepen above.

Thanks Ben, I'll take care of that.

Elijbet avatar Aug 04 '22 23:08 Elijbet

Installed and assigned for verification.

github-actions[bot] avatar Aug 23 '22 19:08 github-actions[bot]

Verified in beta.93

geospatialem avatar Sep 12 '22 19:09 geospatialem