madebymany / sir-trevor-js

Rich content editing entirely re-imagined for the web
http://madebymany.github.io/sir-trevor-js/
MIT License
4.51k stars 397 forks source link

Reordering Iframes/embeds causes blocks to be blanked #549

Open prdanelli opened 6 years ago

prdanelli commented 6 years ago

After some digging I found that the onDragStart method within block-reorder.js creates a cloned element, however if the block is an embed, then the process never completes, so st-block--dragging class is never removed from the block and it looks like its crashed.

The following method seems to work perfectly without generating the text preview:

onDragStart: function onDragStart(ev) {
  var block = this.block;
  ev.dataTransfer.setData("text/plain", this.blockId());
  this.mediator.trigger("block-controls:hide");
  EventBus.trigger("block:reorder:dragstart");
},
raffij commented 6 years ago

Is this something you'd like to submit as a pull request?

prdanelli commented 6 years ago

No problem. I've added it here: https://github.com/madebymany/sir-trevor-js/pull/550