Skip to content

Commit 7d00d30

Browse files
tischsoicKamilSznajdrowicz
authored andcommitted
IBX-9975: Fix console error after removing image in CKEditor
1 parent c62164b commit 7d00d30

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)