Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #339 from ckeditor/i/353
Browse files Browse the repository at this point in the history
Fix: Focus the editor before executing toolbar buttons' command. See ckeditor/ckeditor5#353.
  • Loading branch information
Reinmar authored Jan 28, 2020
2 parents 8f06626 + 8079b8f commit 5a700a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/imagestyle/imagestyleui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
} );
Expand Down
4 changes: 3 additions & 1 deletion src/imagetextalternative/imagetextalternativeui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
} );
Expand Down

0 comments on commit 5a700a2

Please sign in to comment.