From 4f22176b8fa69e14b69c06585e83267bc88682cc Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Mon, 17 Jul 2023 14:10:40 +0900
Subject: perf(frontend): improve performance of contextmenu

Resolve #11303
---
 packages/frontend/src/components/MkContextMenu.vue | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

(limited to 'packages/frontend/src/components/MkContextMenu.vue')

diff --git a/packages/frontend/src/components/MkContextMenu.vue b/packages/frontend/src/components/MkContextMenu.vue
index fb11834f4d..f39c944199 100644
--- a/packages/frontend/src/components/MkContextMenu.vue
+++ b/packages/frontend/src/components/MkContextMenu.vue
@@ -61,15 +61,11 @@ onMounted(() => {
 	rootEl.style.top = `${top}px`;
 	rootEl.style.left = `${left}px`;
 
-	for (const el of Array.from(document.querySelectorAll('body *'))) {
-		el.addEventListener('mousedown', onMousedown);
-	}
+	document.body.addEventListener('mousedown', onMousedown);
 });
 
 onBeforeUnmount(() => {
-	for (const el of Array.from(document.querySelectorAll('body *'))) {
-		el.removeEventListener('mousedown', onMousedown);
-	}
+	document.body.removeEventListener('mousedown', onMousedown);
 });
 
 function onMousedown(evt: Event) {
-- 
cgit v1.2.3-freya

