diff --git a/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-command.js b/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-command.js index 05387566..17f3454a 100644 --- a/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-command.js +++ b/src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-command.js @@ -4,7 +4,9 @@ class IbexaRemoveElementCommand extends Command { execute() { this.editor.model.change((writer) => { const selectedElement = this.editor.model.document.selection.getSelectedElement(); + const positionBefore = writer.createPositionBefore(selectedElement); + writer.setSelection(positionBefore); writer.remove(selectedElement); }); }