fix(frontend): mention popover respects shouldBelow for above/below placement
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.
This commit is contained in:
parent
3a164f6dcc
commit
434a3595eb
@ -363,8 +363,6 @@ export function MentionPopover({
|
|||||||
cursorSpan.textContent = '|';
|
cursorSpan.textContent = '|';
|
||||||
clone.appendChild(cursorSpan);
|
clone.appendChild(cursorSpan);
|
||||||
document.body.appendChild(clone);
|
document.body.appendChild(clone);
|
||||||
|
|
||||||
const cRect = clone.getBoundingClientRect();
|
|
||||||
document.body.removeChild(clone);
|
document.body.removeChild(clone);
|
||||||
|
|
||||||
const popoverWidth = 320;
|
const popoverWidth = 320;
|
||||||
@ -377,7 +375,7 @@ export function MentionPopover({
|
|||||||
? contentTop + lineHeight + 8
|
? contentTop + lineHeight + 8
|
||||||
: Math.max(vp, contentTop - popoverHeight - 8);
|
: Math.max(vp, contentTop - popoverHeight - 8);
|
||||||
|
|
||||||
setPosition({ top: contentTop + borderTop + lineHeight + 8, left: contentLeft + borderLeft });
|
setPosition({ top, left: contentLeft });
|
||||||
|
|
||||||
document.body.removeChild(tempDiv);
|
document.body.removeChild(tempDiv);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user