Skip to content

Commit 45d654f

Browse files
committed
IBX-9975: Fix console error after removing image in CKEditor
1 parent 4a4a170 commit 45d654f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/bundle/Resources/public/js/CKEditor/remove-element/remove-element-command.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ class IbexaRemoveElementCommand extends Command {
44
execute() {
55
this.editor.model.change((writer) => {
66
const selectedElement = this.editor.model.document.selection.getSelectedElement();
7+
const positionBefore = writer.createPositionBefore(selectedElement);
78

9+
writer.setSelection(positionBefore);
810
writer.remove(selectedElement);
911
});
1012
}

0 commit comments

Comments
 (0)