From 434a3595eb8ba6adcd0c55fb1d02a3afcf33c2ea Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Sat, 18 Apr 2026 11:11:39 +0800 Subject: [PATCH] fix(frontend): mention popover respects shouldBelow for above/below placement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ShouldBelow was computed but ignored — popover always rendered below the cursor. Now uses shouldBelow correctly to render above when insufficient space below. Also removes unused cRect clone measurement. --- src/components/room/MentionPopover.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/room/MentionPopover.tsx b/src/components/room/MentionPopover.tsx index 9472f64..2479f34 100644 --- a/src/components/room/MentionPopover.tsx +++ b/src/components/room/MentionPopover.tsx @@ -363,8 +363,6 @@ export function MentionPopover({ cursorSpan.textContent = '|'; clone.appendChild(cursorSpan); document.body.appendChild(clone); - - const cRect = clone.getBoundingClientRect(); document.body.removeChild(clone); const popoverWidth = 320; @@ -377,7 +375,7 @@ export function MentionPopover({ ? contentTop + lineHeight + 8 : Math.max(vp, contentTop - popoverHeight - 8); - setPosition({ top: contentTop + borderTop + lineHeight + 8, left: contentLeft + borderLeft }); + setPosition({ top, left: contentLeft }); document.body.removeChild(tempDiv);