Skip to content

Commit

Permalink
fix: link-plugin reverseRelativePosition error
Browse files Browse the repository at this point in the history
  • Loading branch information
big-camel committed Feb 28, 2023
1 parent 9e476eb commit 788290b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/great-peaches-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@editablejs/plugin-link': patch
---

Fixed an error in the calculation of the initial position during the initialization of the link plugin.
2 changes: 1 addition & 1 deletion packages/plugins/link/src/components/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const LinkCreateComponent: FC<LinkCreateComponentProps> = () => {

const rects = useSelectionDrawingRects()

useIsomorphicLayoutEffect(() => {
useEffect(() => {
if (rects.length > 0) {
const rect = rects[rects.length - 1]
const [x, y] = Editable.reverseRelativePosition(editor, rect.x, rect.bottom)
Expand Down

0 comments on commit 788290b

Please sign in to comment.