diff --git a/packages/ckeditor5-link/src/linkui.ts b/packages/ckeditor5-link/src/linkui.ts index e8578ec678b..60b644cab76 100644 --- a/packages/ckeditor5-link/src/linkui.ts +++ b/packages/ckeditor5-link/src/linkui.ts @@ -625,7 +625,15 @@ export default class LinkUI extends Plugin { view.bind( 'isOn' ).to( command, 'value', value => !!value ); // Show the panel on button click. - this.listenTo( view, 'execute', () => this._showUI( true ) ); + this.listenTo( view, 'execute', () => { + this._showUI( true ); + + // Open the form view on-top of the toolbar view if it's already visible. + // It should be visible every time the link is selected. + if ( this._getSelectedLinkElement() ) { + this._addFormView(); + } + } ); return view; } diff --git a/packages/ckeditor5-link/tests/linkui.js b/packages/ckeditor5-link/tests/linkui.js index 05536bf1806..bc5c3387b67 100644 --- a/packages/ckeditor5-link/tests/linkui.js +++ b/packages/ckeditor5-link/tests/linkui.js @@ -172,6 +172,14 @@ describe( 'LinkUI', () => { expect( linkUIFeature.formView.backButtonView.isVisible ).to.be.false; } ); + + it( 'should open on-top of the toolbar if the link is selected', () => { + setModelData( editor.model, '<$text linkHref="url">f[]oo' ); + + linkButton.fire( 'execute' ); + + expect( balloon.visibleView ).to.equal( linkUIFeature.formView ); + } ); } describe( 'the "linkPreview" toolbar button', () => {