From b3c0c6124e4970605cf89a3c7985e499cd171590 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Sun, 12 Feb 2023 21:56:01 -0500 Subject: [PATCH] FOCUS TRAPPING!!!! --- package.json | 2 + .../client/src/components/MkMenu.child.vue | 5 ++- packages/client/src/components/MkMenu.vue | 8 +--- packages/client/src/components/MkModal.vue | 13 ++++--- .../client/src/components/MkModalWindow.vue | 29 +++++++------- pnpm-lock.yaml | 38 ++++++++++++++++++- 6 files changed, 68 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index e8da6c5a73..34015128b4 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,8 @@ "@bull-board/ui": "^4.10.2", "@tensorflow/tfjs": "^3.21.0", "calckey-js": "^0.0.22", + "focus-trap": "^7.2.0", + "focus-trap-vue": "^4.0.1", "js-yaml": "4.1.0", "phosphor-icons": "^1.4.2", "seedrandom": "^3.0.5" diff --git a/packages/client/src/components/MkMenu.child.vue b/packages/client/src/components/MkMenu.child.vue index 3ada4afbdc..ee0514aab3 100644 --- a/packages/client/src/components/MkMenu.child.vue +++ b/packages/client/src/components/MkMenu.child.vue @@ -1,6 +1,8 @@ @@ -9,6 +11,7 @@ import { on } from 'events'; import { nextTick, onBeforeUnmount, onMounted, onUnmounted, ref, watch } from 'vue'; import MkMenu from './MkMenu.vue'; import { MenuItem } from '@/types/menu'; +import { FocusTrap } from 'focus-trap-vue'; import * as os from '@/os'; const props = defineProps<{ diff --git a/packages/client/src/components/MkMenu.vue b/packages/client/src/components/MkMenu.vue index be7cd72bd7..b7fd75478d 100644 --- a/packages/client/src/components/MkMenu.vue +++ b/packages/client/src/components/MkMenu.vue @@ -1,7 +1,7 @@