From 6e4ecf3483752e2789717abf81284e958f0fc61f Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 8 Mar 2024 15:55:22 +0800 Subject: [PATCH] :iphone: ai --- app/src/ai/actions.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/ai/actions.ts b/app/src/ai/actions.ts index 8de2287c2..25aa43325 100644 --- a/app/src/ai/actions.ts +++ b/app/src/ai/actions.ts @@ -270,6 +270,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { while (target && !target.isSameNode(element)) { if (target.classList.contains("b3-list-item__action")) { editDialog(target.previousElementSibling.textContent, target.parentElement.getAttribute("aria-label")); + menu.close(); event.stopPropagation(); event.preventDefault(); break; @@ -281,17 +282,20 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { fillContent(protyle, response.data, elements); }); } + menu.close(); event.stopPropagation(); event.preventDefault(); break; } target = target.parentElement; } - menu.close(); }); } }); menu.element.querySelector(".b3-menu__items").setAttribute("style", "overflow: initial"); + /// #if MOBILE + menu.fullscreen(); + /// #else const rect = elements[elements.length - 1].getBoundingClientRect(); menu.open({ x: rect.left, @@ -299,4 +303,5 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { h: rect.height, }); menu.element.querySelector("input").focus(); + /// #endif };