Is there a 'Lexical way' to copy text content to clipboard ? #4657
Replies: 2 comments
-
|
There isn't an 'officially endorsed way', but a slightly better implementation you can have a look is this one: lexical/packages/lexical-playground/src/nodes/TableComponent.tsx Lines 1139 to 1168 in 5162dd2 |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @ivailop7 for your reply -- I actually think to solve the problem I'm facing I need to override I'm not sure if this is the correct approach, since it seems initially a From your experience, do you have any better ideas how this can be achieved ? Thanks a lot |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently trying to create a copy to clipboard function, where I have a clipboard icon above the editor.
Here is my current implementation:
I am able to receive the copied content, but for some reason it seems to enter 1 more line than between new paragraph nodes.
I took a look at the
copyToClipboardplugin, but I don't understand how the API is supposed to work or help.Any insights would be greatly appreciated.
❗️I can also confirm it seems to be registering linebreaks for each paragraph node. But it also registers multiple sometimes as confirmed by the
/nline breaks in the console logBeta Was this translation helpful? Give feedback.
All reactions