Skip to content

Commit

Permalink
Update Modal.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell authored Nov 8, 2024
1 parent 7577328 commit ea1aee5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stubs/inertia-vue/resources/js/Components/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ watch(() => props.show, () => {
if (props.show) {
document.body.style.overflow = 'hidden';
showSlot.value = true;
dialog.value?.showModal();
} else {
document.body.style.overflow = '';
setTimeout(() => {
dialog.value?.close();
showSlot.value = false;
Expand Down Expand Up @@ -54,6 +56,7 @@ onMounted(() => document.addEventListener('keydown', closeOnEscape));
onUnmounted(() => {
document.removeEventListener('keydown', closeOnEscape);
document.body.style.overflow = '';
});
Expand Down Expand Up @@ -98,4 +101,4 @@ const maxWidthClass = computed(() => {
</Transition>
</div>
</dialog>
</template>
</template>

0 comments on commit ea1aee5

Please sign in to comment.