From 58894838f0e834e1e1f990d2cce2515b6bf99336 Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 4 Aug 2023 14:53:47 +0000 Subject: [PATCH] fix lint --- packages/frontend/src/components/MkMenu.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkMenu.vue b/packages/frontend/src/components/MkMenu.vue index bbb63c0c23..3a1041acf6 100644 --- a/packages/frontend/src/components/MkMenu.vue +++ b/packages/frontend/src/components/MkMenu.vue @@ -125,7 +125,7 @@ watch(() => props.items, () => { immediate: true, }); -let childMenu = ref(); +const childMenu = ref(); let childTarget = $shallowRef(); function closeChild() { @@ -142,7 +142,7 @@ const onGlobalMousedown = (event: MouseEvent) => { if (childTarget && (event.target === childTarget || childTarget.contains(event.target))) return; if (child && child.checkHit(event)) return; closeChild(); -} +}; let childCloseTimer: null | number = null; function onItemMouseEnter(item) { @@ -182,7 +182,8 @@ function showChildren(item: MenuParent, ev: MouseEvent) { emit('hide'); } else { childTarget = ev.currentTarget ?? ev.target; - childMenu = children as Ref; + // これでもリアクティビティは保たれる + childMenu.value = children.value as MenuItem[]; childShowingItem = item; } } @@ -212,7 +213,7 @@ function switchItem(item: MenuSwitch & { ref: any }) { onMounted(() => { if (props.viaKeyboard) { nextTick(() => { - focusNext(itemsEl.children[0], true, false); + if (itemsEl) focusNext(itemsEl.children[0], true, false); }); }