question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cut and Paste (CMD+X -> CMD+P) does not restore pasted custom block with it's data

See original GitHub issue

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:

  • I am not sure if the pasteConfig is correct, as I render a div with some other elements inside. Not sure what’s the correct pattern/tag then.
  • Not sure how to make sure 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.

Screen Capture on 2019-11-22 at 11-33-20

Environment

  • React: "react": "16.11.0"
  • Editorjs: "@editorjs/editorjs": "2.15.1"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
natterstefancommented, Mar 17, 2020

Awesome, so far I can confirm it works. Thank you @neSpecc.

2reactions
neSpecccommented, Mar 14, 2020

Resolved by #1060 Released in 2.17.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Recover All Broken Blocks In One Command in ...
While logged into your WordPress site, edit the post that has the broken blocks. · Press CTRL + SHIFT + J on Windows...
Read more >
Block Contains unexpected or invalid content. Attempt Block ...
There is no errors within the blocks as it does pull the data no issues. The HTML code is generated and I simply...
Read more >
How to paste commands in command blocks - YouTube
How to paste commands in command blocks for the new Minecraft Bedrock Edition!Today we show you all how to pasta any command into...
Read more >
Untitled
Vahan sewa fancy no, The alexander graham bell wetherspoons, Veneta cucine oyster ... Report text about animal cow, Custom chocolate bar wrappers canada?...
Read more >
Propeller II - Page 33 — Parallax Forums
No one's mentioned this but the SD card booting scheme will fail because of multi block mode if ... Pointer points to raw...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found