medium-editor-insert-plugin
medium-editor-insert-plugin copied to clipboard
Content dissapears on click
It's a weird behaviour. It must be in someplace inside this library, angular-medium or medium-editor itself.
See it running: http://codepen.io/Mr-K/pen/vGbaMy
As you can see, we have multiple instances of medium-editor working which each contains an initial value. The content is binded, and it seems ready to edit.
So far so good. BUT when you click at it, the content is replaced by nothing. It's missing. Gone, completely. You can see it in the codepen above.
Any clues?
The problem is in this library. Without including it, it works just fine.
You have a lot of additional code in your codepen example. Can you verify that even if you strip everything and leave only MediumEditor + plugin, the bug is still there?
@matikbird was the content you want to edit with editor with insert plugin preprocessed with medium editor?
In my case, I had one form which was filled by user with plain text. User clicked save and post with plain text was saved to db. Than user could edit it, but with medium editor this time. I prefilled medium editor with post plain text from db using editor.setContent(content, 0);
. After clicking editor contenteditable, content disappeared!
The solution is to surround content with p tags and only then paste them to editor with method mentioned.
Maybe that's your case?
Actually I'm waiting for the 3.0v that @orthes it's developing, full standalone. The current has a lot of libraries on it, like handlebars ─a template system─... and the whole thing contains like 10 buttons. But I fell in love with the 3.0v. I'd rather waiting with what @orthes is doing, which's amazing.