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

Commit

Permalink
Mention contextual balloon panel should be opened with singleViewMode…
Browse files Browse the repository at this point in the history
…=true.
  • Loading branch information
jodator committed May 27, 2019
1 parent de9ee71 commit 14501dc
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 14501dc

Please sign in to comment.