Fix source copy when clipboardData not available

Bug: T190881
Change-Id: I8569dec0c03caa30cb7fcbbbfeed126dc9db57e4
This commit is contained in:
Ed Sanders 2018-03-29 13:58:00 +01:00
parent 5b36d88eae
commit 58054d49da

View file

@ -61,7 +61,7 @@ ve.ce.MWWikitextSurface.prototype.onCopy = function ( e ) {
// Prevent surface observation due to native range changing
this.surfaceObserver.disable();
this.$pasteTarget.append( this.pasteTargetInput.$element );
this.$pasteTarget.empty().append( this.pasteTargetInput.$element );
this.pasteTargetInput.setValue( text ).select();
// Restore scroll position after changing focus
@ -77,7 +77,7 @@ ve.ce.MWWikitextSurface.prototype.onCopy = function ( e ) {
view.surfaceObserver.clear();
view.surfaceObserver.enable();
// Detach input
this.pasteTargetInput.$element.detach();
view.pasteTargetInput.$element.detach();
} );
}
};