Skip to content

LinkPreview onHover #3372

Discussion options

You must be logged in to vote

I found a working solution, at least for me.
On my root component under my LexicalComposer I added onMouseOver and onMouseLeave to detect hover events. I than checked if the hovered element or one of its parents have the nodeName "A" (=> it must be a link). If its the case I save the element and use it in combination with a mui popper as anchor element. The mui popper is like any other plugin part of my lexical composer.

 <LexicalComposer
         initialConfig={{
            namespace: "MyEditor",
            theme,
            editable: editable,
            nodes: nodeDependencies,
            onError,
         }}
      >
         <StyledRoot onMouseOver={handleOnMouseOverRoot} onMouse…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LamprechtRobin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant