From 075a98d4447b8133c390efbeccb504f5e9144fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Zed=C3=A9n=20Yver=C3=A5s?= Date: Wed, 26 Jun 2024 20:38:49 +0200 Subject: [PATCH] fix: remove unused ref --- src/components/LexicalEditor/ToolbarPlugin.jsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/LexicalEditor/ToolbarPlugin.jsx b/src/components/LexicalEditor/ToolbarPlugin.jsx index fd021ad..93f81c7 100644 --- a/src/components/LexicalEditor/ToolbarPlugin.jsx +++ b/src/components/LexicalEditor/ToolbarPlugin.jsx @@ -89,7 +89,6 @@ function positionEditorElement(editor, rect) { function FloatingLinkEditor({ editor }) { const editorRef = useRef(null); const inputRef = useRef(null); - const mouseDownRef = useRef(false); const [linkUrl, setLinkUrl] = useState(""); const [isEditMode, setEditMode] = useState(false); const [lastSelection, setLastSelection] = useState(null); @@ -134,9 +133,7 @@ function FloatingLinkEditor({ editor }) { rect = domRange.getBoundingClientRect(); } - if (!mouseDownRef.current) { - positionEditorElement(editorElem, rect); - } + positionEditorElement(editorElem, rect); setLastSelection(selection); } else if (!activeElement || activeElement.className !== "link-input") { positionEditorElement(editorElem, null);