fix: Initial positioning of mention menu in comments

This commit is contained in:
Tom Moor
2023-04-05 20:06:24 -04:00
parent 99e4b458df
commit 6c16ffb99a
2 changed files with 10 additions and 1 deletions

View File

@@ -88,6 +88,7 @@ function SuggestionsMenu<T extends MenuItem>(props: Props<T>) {
const calculatePosition = React.useCallback(
(props: Props) => {
console.log("calculatePosition");
if (!props.isActive) {
return defaultPosition;
}
@@ -141,7 +142,7 @@ function SuggestionsMenu<T extends MenuItem>(props: Props<T>) {
leftPos = right - offsetWidth;
}
if (top - offsetHeight > margin) {
if (top - offsetHeight > offsetParent.top + margin) {
return {
left: leftPos,
top: undefined,