From 43c556c06c094843a5809dbc694f1c373bf1c55a Mon Sep 17 00:00:00 2001 From: Felix Feng Date: Fri, 25 Oct 2024 15:24:18 +0800 Subject: [PATCH] fix --- .changeset/khaki-peaches-lick.md | 5 +++++ packages/cursor/src/hooks/useCursorOverlayPositions.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/khaki-peaches-lick.md 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 =