Browse Source

Merge pull request #6066 from ckeditor/i/353

Fix: Focus the editor before executing toolbar buttons' command. Closes #353.
Piotrek Koszuliński 5 years ago
parent
commit
0d0505f900
1 changed files with 4 additions and 1 deletions
  1. 4 1
      docs/_snippets/framework/tutorials/block-widget.js

+ 4 - 1
docs/_snippets/framework/tutorials/block-widget.js

@@ -52,7 +52,10 @@ class SimpleBoxUI extends Plugin {
 			buttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
 
 			// Execute the command when the button is clicked (executed).
-			this.listenTo( buttonView, 'execute', () => editor.execute( 'insertSimpleBox' ) );
+			this.listenTo( buttonView, 'execute', () => {
+				editor.execute( 'insertSimpleBox' );
+				editor.editing.view.focus();
+			} );
 
 			return buttonView;
 		} );