mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 20:09:35 +00:00
feat(modal): dispatch transitionend event
This commit is contained in:
parent
ea4420e323
commit
cbea1df97a
6 changed files with 52 additions and 25 deletions
|
@ -1,4 +1,8 @@
|
|||
<script>
|
||||
/**
|
||||
* @event {{ open: boolean; }} transitionend
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set the size of the composed modal
|
||||
* @type {"xs" | "sm" | "lg"}
|
||||
|
@ -102,8 +106,11 @@
|
|||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
on:transitionend
|
||||
on:transitionend="{({ currentTarget }) => {
|
||||
on:transitionend="{({ propertyName, currentTarget }) => {
|
||||
if (propertyName === 'transform') {
|
||||
dispatch('transitionend', { open });
|
||||
}
|
||||
|
||||
if (didOpen) {
|
||||
focus(currentTarget);
|
||||
didOpen = false;
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<script>
|
||||
/**
|
||||
* @event {{ open: boolean; }} transitionend
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set the size of the modal
|
||||
* @type {"xs" | "sm" | "lg"}
|
||||
|
@ -151,6 +155,11 @@
|
|||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
on:transitionend="{(e) => {
|
||||
if (e.propertyName === 'transform') {
|
||||
dispatch('transitionend', { open });
|
||||
}
|
||||
}}"
|
||||
>
|
||||
<div
|
||||
bind:this="{innerModal}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue