diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaInsertDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaInsertDialog.js index d37b86f323..c0155810f7 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaInsertDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaInsertDialog.js @@ -68,7 +68,7 @@ ve.ui.MWMediaInsertDialog.prototype.onClose = function ( action ) { if ( action === 'insert' ) { info = this.item.imageinfo[0]; - this.surface.getModel().getFragment().insertContent( [ + this.surface.getModel().getFragment().collapseRangeToEnd().insertContent( [ { 'type': 'mwBlockImage', 'attributes': {