Skip to content

Commit

Permalink
Merge pull request #107 from takuma-ru/fix/91
Browse files Browse the repository at this point in the history
🐛 Add cancel event listener to SwipeModal
  • Loading branch information
takuma-ru committed May 9, 2024
2 parents 696303a + 35ed6b3 commit b722fb5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/src/components/SwipeModal/SwipeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ onMounted(() => {
modalRef.value.style.setProperty("bottom", `var(--${scopeName}-bottom)`);
modalRef.value.addEventListener("cancel", () => {
vModel.value = false;
});
if (!vModel.value) {
// モーダル内のエレメントを取得できるように display を none を無効化
modalRef.value.style.setProperty("display", "initial");
Expand All @@ -279,6 +283,9 @@ onUnmounted(() => {
removeCssVar("bottom");
removeCssVar("movementAmountY");
removeCssVar("snapPointPosition");
if (modalRef.value)
modalRef.value.removeEventListener("cancel", () => {});
});
</script>

Expand Down

0 comments on commit b722fb5

Please sign in to comment.