Skip to content

Commit

Permalink
suffix with experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
potatowagon committed Aug 28, 2024
1 parent 21cb22c commit 8dbc6bf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/lexical-react/src/shared/LexicalMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ export function useMenuAnchorRef(
setResolution: (r: MenuResolution | null) => void,
className?: string,
parent: HTMLElement = document.body,
shouldIncludePageYOffset: boolean = true,
shouldIncludePageYOffset__EXPERIMENTAL: boolean = true,
): MutableRefObject<HTMLElement> {
const [editor] = useLexicalComposerContext();
const anchorElementRef = useRef<HTMLElement>(document.createElement('div'));
Expand All @@ -499,7 +499,7 @@ export function useMenuAnchorRef(
top +
anchorHeight +
3 +
(shouldIncludePageYOffset ? window.pageYOffset : 0)
(shouldIncludePageYOffset__EXPERIMENTAL ? window.pageYOffset : 0)
}px`;
containerDiv.style.left = `${left + window.pageXOffset}px`;
containerDiv.style.height = `${height}px`;
Expand All @@ -526,7 +526,7 @@ export function useMenuAnchorRef(
top -
menuHeight -
height +
(shouldIncludePageYOffset ? window.pageYOffset : 0)
(shouldIncludePageYOffset__EXPERIMENTAL ? window.pageYOffset : 0)
}px`;
}
}
Expand All @@ -545,7 +545,13 @@ export function useMenuAnchorRef(
anchorElementRef.current = containerDiv;
rootElement.setAttribute('aria-controls', 'typeahead-menu');
}
}, [editor, resolution, className, parent]);
}, [
editor,
resolution,
shouldIncludePageYOffset__EXPERIMENTAL,
className,
parent,
]);

useEffect(() => {
const rootElement = editor.getRootElement();
Expand Down

0 comments on commit 8dbc6bf

Please sign in to comment.