8
0
Эх сурвалжийг харах

Fix: Focus the editor before executing a command

panr 6 жил өмнө
parent
commit
ac00a25c6a

+ 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;
 		} );