fix: initial modal scroll lock
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Dominik Pschenitschni 2022-10-04 21:18:38 +02:00
parent 114724faaa
commit 668a6f9312
Signed by: dpschen
GPG Key ID: B257AC0149F43A77
1 changed files with 4 additions and 10 deletions

View File

@ -71,10 +71,9 @@ export default {
<script lang="ts" setup>
import BaseButton from '@/components/base/BaseButton.vue'
import {onUnmounted, ref, useAttrs, watch} from 'vue'
import {ref, useAttrs, watchEffect} from 'vue'
import {useScrollLock} from '@vueuse/core'
const props = withDefaults(defineProps<{
enabled?: boolean,
overflow?: boolean,
@ -94,14 +93,9 @@ const attrs = useAttrs()
const modal = ref<HTMLElement | null>(null)
const scrollLock = useScrollLock(modal)
watch(
() => props.enabled,
enabled => {
scrollLock.value = enabled
},
)
onUnmounted(() => scrollLock.value = false)
watchEffect(() => {
scrollLock.value = props.enabled
})
</script>
<style lang="scss" scoped>