Skip to content

Commit

Permalink
Revert "[lexical-playground] Fix: in playground show component-menu w… (
Browse files Browse the repository at this point in the history
  • Loading branch information
zurfyx committed Aug 26, 2024
1 parent 8dafdb1 commit 36b8eab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/lexical-react/src/shared/LexicalMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,9 @@ export function useMenuAnchorRef(
if (rootElement !== null && resolution !== null) {
const {left, top, width, height} = resolution.getRect();
const anchorHeight = anchorElementRef.current.offsetHeight; // use to position under anchor
containerDiv.style.top = `${top + anchorHeight + 3}px`;
containerDiv.style.top = `${
top + window.pageYOffset + anchorHeight + 3
}px`;
containerDiv.style.left = `${left + window.pageXOffset}px`;
containerDiv.style.height = `${height}px`;
containerDiv.style.width = `${width}px`;
Expand All @@ -516,7 +518,9 @@ export function useMenuAnchorRef(
top + menuHeight > rootElementRect.bottom) &&
top - rootElementRect.top > menuHeight + height
) {
containerDiv.style.top = `${top - menuHeight - height}px`;
containerDiv.style.top = `${
top - menuHeight + window.pageYOffset - height
}px`;
}
}

Expand Down

0 comments on commit 36b8eab

Please sign in to comment.