Skip to content

Commit 36b8eab

Browse files
authored
Revert "[lexical-playground] Fix: in playground show component-menu w… (#6558)
1 parent 8dafdb1 commit 36b8eab

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/lexical-react/src/shared/LexicalMenu.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ export function useMenuAnchorRef(
494494
if (rootElement !== null && resolution !== null) {
495495
const {left, top, width, height} = resolution.getRect();
496496
const anchorHeight = anchorElementRef.current.offsetHeight; // use to position under anchor
497-
containerDiv.style.top = `${top + anchorHeight + 3}px`;
497+
containerDiv.style.top = `${
498+
top + window.pageYOffset + anchorHeight + 3
499+
}px`;
498500
containerDiv.style.left = `${left + window.pageXOffset}px`;
499501
containerDiv.style.height = `${height}px`;
500502
containerDiv.style.width = `${width}px`;
@@ -516,7 +518,9 @@ export function useMenuAnchorRef(
516518
top + menuHeight > rootElementRect.bottom) &&
517519
top - rootElementRect.top > menuHeight + height
518520
) {
519-
containerDiv.style.top = `${top - menuHeight - height}px`;
521+
containerDiv.style.top = `${
522+
top - menuHeight + window.pageYOffset - height
523+
}px`;
520524
}
521525
}
522526

0 commit comments

Comments
 (0)