From 988a25a7008b844341157f6a18fa64c37f70b13f Mon Sep 17 00:00:00 2001 From: Jingkang Zhang Date: Fri, 26 Apr 2024 17:11:18 -0400 Subject: [PATCH] fix(@lexical/react/LexicalMenu) Fix check for menu cannot fit on top (#5743) --- packages/lexical-react/src/shared/LexicalMenu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lexical-react/src/shared/LexicalMenu.ts b/packages/lexical-react/src/shared/LexicalMenu.ts index 4e16007f972..590e5cfdc57 100644 --- a/packages/lexical-react/src/shared/LexicalMenu.ts +++ b/packages/lexical-react/src/shared/LexicalMenu.ts @@ -516,7 +516,7 @@ export function useMenuAnchorRef( if ( (top + menuHeight > window.innerHeight || top + menuHeight > rootElementRect.bottom) && - top - rootElementRect.top > menuHeight + top - rootElementRect.top > menuHeight + height ) { containerDiv.style.top = `${ top - menuHeight + window.pageYOffset - height