fix: pass modal bindings to teleport target (#2109)
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2109 Reviewed-by: konrad <k@knt.li> Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de> Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:
parent
dff5d84ebb
commit
6e54929104
1 changed files with 14 additions and 4 deletions
|
@ -6,10 +6,11 @@
|
||||||
v-if="enabled"
|
v-if="enabled"
|
||||||
class="modal-mask"
|
class="modal-mask"
|
||||||
:class="[
|
:class="[
|
||||||
{ 'has-overflow': overflow },
|
{ 'has-overflow': overflow },
|
||||||
variant,
|
variant,
|
||||||
]"
|
]"
|
||||||
ref="modal"
|
ref="modal"
|
||||||
|
v-bind="attrs"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="modal-container"
|
class="modal-container"
|
||||||
|
@ -62,11 +63,18 @@
|
||||||
</Teleport>
|
</Teleport>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
inheritAttrs: false,
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import BaseButton from '@/components/base/BaseButton.vue'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import {onUnmounted, ref, watch} from 'vue'
|
import {onUnmounted, ref, useAttrs, watch} from 'vue'
|
||||||
import {useScrollLock} from '@vueuse/core'
|
import {useScrollLock} from '@vueuse/core'
|
||||||
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
enabled?: boolean,
|
enabled?: boolean,
|
||||||
overflow?: boolean,
|
overflow?: boolean,
|
||||||
|
@ -81,6 +89,8 @@ const props = withDefaults(defineProps<{
|
||||||
|
|
||||||
defineEmits(['close', 'submit'])
|
defineEmits(['close', 'submit'])
|
||||||
|
|
||||||
|
const attrs = useAttrs()
|
||||||
|
|
||||||
const modal = ref<HTMLElement | null>(null)
|
const modal = ref<HTMLElement | null>(null)
|
||||||
const scrollLock = useScrollLock(modal)
|
const scrollLock = useScrollLock(modal)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue