Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #75 from ckeditor/t/74
Browse files Browse the repository at this point in the history
Fix: The mention panel should have precendence over all other panels. Closes #74.
  • Loading branch information
Reinmar authored May 28, 2019
2 parents de9ee71 + 14501dc commit 3e8a84c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mentionui.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ export default class MentionUI extends Plugin {
this._balloon.add( {
view: this._mentionsView,
position: this._getBalloonPanelPositionData( markerMarker, this._mentionsView.position ),
withArrow: false
withArrow: false,
singleViewMode: true,
stack: 'mention'
} );
}

Expand Down
8 changes: 8 additions & 0 deletions tests/mentionui.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,15 @@ describe( 'MentionUI', () => {
} );

describe( 'contextual balloon', () => {
let balloonAddSpy;

beforeEach( () => {
return createClassicTestEditor( staticConfig )
.then( () => {
setData( model, '<paragraph>foo []</paragraph>' );
const contextualBalloon = editor.plugins.get( ContextualBalloon );

balloonAddSpy = sinon.spy( contextualBalloon, 'add' );

model.change( writer => {
writer.insertText( '@', doc.selection.getFirstPosition() );
Expand All @@ -109,6 +114,9 @@ describe( 'MentionUI', () => {
} );

it( 'should disable arrow', () => {
sinon.assert.calledOnce( balloonAddSpy );
sinon.assert.calledWithExactly( balloonAddSpy, sinon.match( data => data.singleViewMode ) );
sinon.assert.calledWithExactly( balloonAddSpy, sinon.match( data => data.stack == 'mention' ) );
expect( panelView.isVisible ).to.be.true;
expect( panelView.withArrow ).to.be.false;
} );
Expand Down

0 comments on commit 3e8a84c

Please sign in to comment.