瀏覽代碼

Fix: Focus the editor before executing a command

panr 5 年之前
父節點
當前提交
ecb6f6b57f
共有 1 個文件被更改,包括 4 次插入1 次删除
  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;
 		} );