Skip to content

Commit

Permalink
fix(RModal): Improvements allowBodyScroll logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gokh4nozturk committed Dec 28, 2023
1 parent e74272e commit 9b9ea91
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Modal/RModal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, watchEffect } from 'vue'
import { computed, onUnmounted, watchEffect } from 'vue'
import './modal.css'
import Icon from '../Icon/RIcon.vue'
Expand Down Expand Up @@ -147,6 +147,12 @@ watchEffect(() => {
document.body.style.overflow = 'hidden'
else
document.body.style.overflow = 'auto'
},
{ flush: 'post' },
)
onUnmounted(() => {
document.body.style.overflow = 'auto'
})
// close on escape
Expand Down

0 comments on commit 9b9ea91

Please sign in to comment.