Kaynağa Gözat

Made sure link balloon will be visible after pressing Ctrl+K.

Oskar Wróbel 6 yıl önce
ebeveyn
işleme
b1f4fb5df3

+ 1 - 1
packages/ckeditor5-link/src/linkui.js

@@ -188,7 +188,7 @@ export default class LinkUI extends Plugin {
 			cancel();
 
 			if ( linkCommand.isEnabled ) {
-				this._showUI();
+				this._showUI( true );
 			}
 		} );
 

+ 21 - 1
packages/ckeditor5-link/tests/linkui.js

@@ -486,7 +486,7 @@ describe( 'LinkUI', () => {
 				preventDefault: sinon.spy(),
 				stopPropagation: sinon.spy()
 			} );
-			sinon.assert.calledWithExactly( spy );
+			sinon.assert.calledWithExactly( spy, true );
 		} );
 
 		it( 'should prevent default action on Ctrl+K keystroke', () => {
@@ -504,6 +504,26 @@ describe( 'LinkUI', () => {
 			sinon.assert.calledOnce( stopPropagationSpy );
 		} );
 
+		it( 'should make stack with link visible on Ctrl+K keystroke', () => {
+			const command = editor.commands.get( 'link' );
+
+			command.isEnabled = true;
+
+			balloon.add( {
+				view: new View(),
+				stackId: 'custom'
+			} );
+
+			editor.keystrokes.press( {
+				keyCode: keyCodes.k,
+				ctrlKey: true,
+				preventDefault: sinon.spy(),
+				stopPropagation: sinon.spy()
+			} );
+
+			expect( balloon.visibleView === formView );
+		} );
+
 		it( 'should focus the the #actionsView on `Tab` key press when #actionsView is visible', () => {
 			const keyEvtData = {
 				keyCode: keyCodes.tab,