Parcourir la source

Fix: Focus the editor before executing a command

panr il y a 5 ans
Parent
commit
ecb6f6b57f
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      packages/ckeditor5-horizontal-line/src/horizontallineui.js

+ 4 - 1
packages/ckeditor5-horizontal-line/src/horizontallineui.js

@@ -35,7 +35,10 @@ export default class HorizontalLineUI extends Plugin {
 			view.bind( 'isEnabled' ).to( command, 'isEnabled' );
 
 			// Execute the command.
-			this.listenTo( view, 'execute', () => editor.execute( 'horizontalLine' ) );
+			this.listenTo( view, 'execute', () => {
+				editor.execute( 'horizontalLine' );
+				editor.editing.view.focus();
+			} );
 
 			return view;
 		} );