Răsfoiți Sursa

Fixed error when editors are created on data, not on elements.

Maciej Bukowski 6 ani în urmă
părinte
comite
8cabb4220a
1 a modificat fișierele cu 6 adăugiri și 6 ștergeri
  1. 6 6
      packages/ckeditor5-watchdog/src/editorwatchdog.js

+ 6 - 6
packages/ckeditor5-watchdog/src/editorwatchdog.js

@@ -143,15 +143,15 @@ export default class EditorWatchdog extends Watchdog {
 				console.error( 'An error happened during the editor destructing.', err );
 			} )
 			.then( () => {
-				if ( typeof this._elementOrData === 'string' ) {
-					return this.create( this._data, this._config );
-				} else {
-					const updatedConfig = Object.assign( {}, this._config, {
+				let config = this._config;
+
+				if ( isElement( this._elementOrData ) ) {
+					config = Object.assign( {}, this._config, {
 						initialData: this._data
 					} );
-
-					return this.create( this._elementOrData, updatedConfig );
 				}
+
+				return this.create( this._elementOrData, config );
 			} )
 			.then( () => {
 				this.fire( 'restart' );