medium-editor-tables
medium-editor-tables copied to clipboard
Deleting rows / colums doesn't work
After removing a row, visually it removes, but after saving the page I still see my table with all rows and it's content (changes are reverting back), so I can not remove row or column at all. Is there some way to fix it?
@must2die
Several ways to solve this:
Edit something via keyboard after using a table related toolbar option or modify the extension... or try to track dom changes inside of the medium editor instance... all this is a bit tricky...
Reason is that changes introduced to the dom directly aren't captured by the Medium Editor and thus the Medium Editor events do not fire.
My solution in this context:
- save the current selection...
- move cursor to the beginning of the editor instance
- paste something unvisible using Medium editor pasteHTML
- remove the something from the dom
- Restore the saved selection
- trigger the Medium editor editableInput event
Probably there's a better way to do this but this recipe works.
Thanks, @leotiger ! That really works for me)
Same problem here.
I found simple solution.
editor.subscribe('blur', function (event, editable) {
// update input with changed MediumEditor html on blur (for example click to submit button)
$('#medium-editor-input').val(editor.getContent());
});