Skip to content

Commit 0d0505f

Browse files
authored
Merge pull request #6066 from ckeditor/i/353
Fix: Focus the editor before executing toolbar buttons' command. Closes #353.
2 parents e346e9a + ac00a25 commit 0d0505f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/_snippets/framework/tutorials/block-widget.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ class SimpleBoxUI extends Plugin {
5252
buttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
5353

5454
// Execute the command when the button is clicked (executed).
55-
this.listenTo( buttonView, 'execute', () => editor.execute( 'insertSimpleBox' ) );
55+
this.listenTo( buttonView, 'execute', () => {
56+
editor.execute( 'insertSimpleBox' );
57+
editor.editing.view.focus();
58+
} );
5659

5760
return buttonView;
5861
} );

0 commit comments

Comments
 (0)