fix: can't click dropdown options in visibility selector (#312)
parent
399712c0c7
commit
3952dd6cd6
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue