File tree 1 file changed +6
-2
lines changed
packages/lexical-react/src/shared
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -494,7 +494,9 @@ export function useMenuAnchorRef(
494
494
if ( rootElement !== null && resolution !== null ) {
495
495
const { left, top, width, height} = resolution . getRect ( ) ;
496
496
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`;
498
500
containerDiv . style . left = `${ left + window . pageXOffset } px` ;
499
501
containerDiv . style . height = `${ height } px` ;
500
502
containerDiv . style . width = `${ width } px` ;
@@ -516,7 +518,9 @@ export function useMenuAnchorRef(
516
518
top + menuHeight > rootElementRect . bottom ) &&
517
519
top - rootElementRect . top > menuHeight + height
518
520
) {
519
- containerDiv . style . top = `${ top - menuHeight - height } px` ;
521
+ containerDiv . style . top = `${
522
+ top - menuHeight + window . pageYOffset - height
523
+ } px`;
520
524
}
521
525
}
522
526
You can’t perform that action at this time.
0 commit comments