diff --git a/packages/textchecker-element/src/attach-to-text-area.ts b/packages/textchecker-element/src/attach-to-text-area.ts index f4f5349..e5b0483 100644 --- a/packages/textchecker-element/src/attach-to-text-area.ts +++ b/packages/textchecker-element/src/attach-to-text-area.ts @@ -105,11 +105,13 @@ export const attachToTextArea = ({ fixable: Boolean(message.fix) }; const abortSignalMap = new WeakMap(); + let isMouseEnter = false; return { id: `${message.ruleId}::${message.line}:${message.column}`, start: message.index, end: message.index + 1, onMouseEnter: ({ rectItem }: { rectItem: TextCheckerElementRectItem }) => { + isMouseEnter = true; const controller = abortSignalMap.get(rectItem); debug("enter", controller); if (controller) { @@ -176,12 +178,13 @@ export const attachToTextArea = ({ }, async onMouseLeave({ rectItem }: { rectItem: TextCheckerElementRectItem }) { try { + isMouseEnter = false; const controller = abortSignalMap.get(rectItem); debug("leave", controller); await delay(500, { signal: controller?.signal }); - if (textCheckerPopup.isHovering) { + if (textCheckerPopup.isHovering || isMouseEnter) { return; } textCheckerPopup.dismissCard(card); diff --git a/packages/textchecker-element/src/text-checker-popup-element.ts b/packages/textchecker-element/src/text-checker-popup-element.ts index 4756558..10b0c02 100644 --- a/packages/textchecker-element/src/text-checker-popup-element.ts +++ b/packages/textchecker-element/src/text-checker-popup-element.ts @@ -333,11 +333,7 @@ export class TextCheckerPopupElement extends HTMLElement { `; } else { - return html` `;