fix: can't click dropdown options in visibility selector (#312)

This commit is contained in:
Ayaka Rizumu 2022-12-03 13:18:24 +08:00 committed by GitHub
parent 399712c0c7
commit 3952dd6cd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,4 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap'
import { useDeactivated } from '~/composables/lifecycle' import { useDeactivated } from '~/composables/lifecycle'
export interface Props { export interface Props {
@ -108,14 +107,6 @@ const isVShow = computed(() => {
const bindTypeToAny = ($attrs: any) => $attrs as any const bindTypeToAny = ($attrs: any) => $attrs as any
const { activate, deactivate } = useFocusTrap(elDialogRoot)
watch(visible, async (value) => {
await nextTick()
if (value)
activate()
else
deactivate()
})
useEventListener('keydown', (e: KeyboardEvent) => { useEventListener('keydown', (e: KeyboardEvent) => {
if (!visible.value) if (!visible.value)
return return