Skip to content

Commit

Permalink
Merge pull request #101 from takuma-ru/fix/94
Browse files Browse the repository at this point in the history
🐛 Fixed `::backdrop` attribute animation not to run in firefox.
  • Loading branch information
takuma-ru authored May 9, 2024
2 parents 15ba259 + 108c29f commit 9faf206
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions packages/core/src/components/SwipeModal/SwipeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,18 @@ const handleOpenModal = () => {
modalRef.value?.style.setProperty("visibility", "visible");
modalRef.value.animate([
{ opacity: 0 },
{ opacity: 1 },
], {
duration: 200,
pseudoElement: "::backdrop",
easing: ANIMATION_EASING,
});
const isFirefox = navigator.userAgent.toLowerCase().includes("firefox");
if (!isFirefox) {
modalRef.value.animate([
{ opacity: 0 },
{ opacity: 1 },
], {
duration: 200,
pseudoElement: "::backdrop",
easing: ANIMATION_EASING,
});
}
modalRef.value.animate(
[
Expand Down Expand Up @@ -161,14 +165,18 @@ const handleCloseModal = () => {
if (!modalRef.value)
return;
modalRef.value.animate([
{ opacity: 1 },
{ opacity: 0 },
], {
duration: 300,
pseudoElement: "::backdrop",
easing: ANIMATION_EASING,
});
const isFirefox = navigator.userAgent.toLowerCase().includes("firefox");
if (!isFirefox) {
modalRef.value.animate([
{ opacity: 1 },
{ opacity: 0 },
], {
duration: 300,
pseudoElement: "::backdrop",
easing: ANIMATION_EASING,
});
}
modalRef.value.animate(
[
Expand Down

0 comments on commit 9faf206

Please sign in to comment.