-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cut and Paste (CMD+X -> CMD+P) does not restore pasted custom block with it's data #954
Comments
i am getting a number in the text object of theresult , if i copy and paste text it puts numbers as shown below :
|
We can add special formatting to the copied text that will allow us to determine block types on pasting. But in this case, copying/pasting to the other regular text documents will contain unwanted extra symbols. We will research this case and find a solution. Maybe this can be done by modifying the DataTransfer object by adding our own mime-type. Or we can provide options on how you want to copy selected fragment: as simple text or as Editorjs format. |
Hi @neSpecc, thanks for the feedback. If I came up with an idea, I'll let you know. |
Resolved by #1060 |
Awesome, so far I can confirm it works. Thank you @neSpecc. |
Issue
In our app we have lot's of "Enrichments". They can have several different types (eg.
image
,audio
, ...). Because of legacy reasons we cannot simply render a<img>
or<audio>
tag.Nevertheless, I was able to register and add custom tools (with React support) for each enrichment type. BUT when one moves them with CMD+X and CMD+P they are added as a simple paragraph or when the block is detected without data.
FTR:
pasteConfig
is correct, as I render adiv
with some other elements inside. Not sure what's the correct pattern/tag then.onPaste
receives existing data from the pasted block as well.Expected outcome
I can copy and paste existing blocks with all it's data within the Editor container.
Example
An example codesandbox can be found here: https://codesandbox.io/s/epic-feynman-myinj.
Environment
"react": "16.11.0"
"@editorjs/editorjs": "2.15.1"
The text was updated successfully, but these errors were encountered: