8
0
Просмотр исходного кода

Fix: Focus the editor before executing a command

panr 6 лет назад
Родитель
Сommit
a501bd6eab

+ 4 - 1
packages/ckeditor5-image/src/imagestyle/imagestyleui.js

@@ -92,7 +92,10 @@ export default class ImageStyleUI extends Plugin {
 			view.bind( 'isEnabled' ).to( command, 'isEnabled' );
 			view.bind( 'isOn' ).to( command, 'value', value => value === style.name );
 
-			this.listenTo( view, 'execute', () => editor.execute( 'imageStyle', { value: style.name } ) );
+			this.listenTo( view, 'execute', () => {
+				editor.execute( 'imageStyle', { value: style.name } );
+				editor.editing.view.focus();
+			} );
 
 			return view;
 		} );

+ 3 - 1
packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js

@@ -78,7 +78,9 @@ export default class ImageTextAlternativeUI extends Plugin {
 
 			view.bind( 'isEnabled' ).to( command, 'isEnabled' );
 
-			this.listenTo( view, 'execute', () => this._showForm() );
+			this.listenTo( view, 'execute', () => {
+				this._showForm();
+			} );
 
 			return view;
 		} );