diff --git a/.changeset/khaki-peaches-lick.md b/.changeset/khaki-peaches-lick.md new file mode 100644 index 0000000000..f7d481c8f5 --- /dev/null +++ b/.changeset/khaki-peaches-lick.md @@ -0,0 +1,5 @@ +--- +'@udecode/plate-cursor': patch +--- + +Fix overlay position when there a fixed height of editor. diff --git a/packages/cursor/src/hooks/useCursorOverlayPositions.ts b/packages/cursor/src/hooks/useCursorOverlayPositions.ts index 9f144153e4..fabfe80480 100644 --- a/packages/cursor/src/hooks/useCursorOverlayPositions.ts +++ b/packages/cursor/src/hooks/useCursorOverlayPositions.ts @@ -47,6 +47,7 @@ export const useCursorOverlayPositions = ({ const contentRect = containerRef.current!.getBoundingClientRect(); xOffset = contentRect.x; yOffset = contentRect.y; + yOffset -= containerRef.current.scrollTop; } let selectionRectsChanged =