calcite-design-system
calcite-design-system copied to clipboard
Add 'before' events for events that fire after a transition
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
-
calcite<Component>Before<Event>
events are added for transition-chained events. - 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 */});
Installed and assigned for verification.
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.
This is looking really good, nice work Eliza!
The only issue I found is that
calciteModalOpen
andcalciteModalBeforeOpen
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=1111I'm assigning this back to dev to get
calciteModalOpen
andcalciteModalBeforeOpen
to emit on page load when relevant, such as the codepen above.
Thanks Ben, I'll take care of that.
Installed and assigned for verification.
Verified in beta.93