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

Commit 3e8a84c

Browse files
authored
Merge pull request #75 from ckeditor/t/74
Fix: The mention panel should have precendence over all other panels. Closes #74.
2 parents de9ee71 + 14501dc commit 3e8a84c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/mentionui.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ export default class MentionUI extends Plugin {
374374
this._balloon.add( {
375375
view: this._mentionsView,
376376
position: this._getBalloonPanelPositionData( markerMarker, this._mentionsView.position ),
377-
withArrow: false
377+
withArrow: false,
378+
singleViewMode: true,
379+
stack: 'mention'
378380
} );
379381
}
380382

tests/mentionui.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,15 @@ describe( 'MentionUI', () => {
9696
} );
9797

9898
describe( 'contextual balloon', () => {
99+
let balloonAddSpy;
100+
99101
beforeEach( () => {
100102
return createClassicTestEditor( staticConfig )
101103
.then( () => {
102104
setData( model, '<paragraph>foo []</paragraph>' );
105+
const contextualBalloon = editor.plugins.get( ContextualBalloon );
106+
107+
balloonAddSpy = sinon.spy( contextualBalloon, 'add' );
103108

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

111116
it( 'should disable arrow', () => {
117+
sinon.assert.calledOnce( balloonAddSpy );
118+
sinon.assert.calledWithExactly( balloonAddSpy, sinon.match( data => data.singleViewMode ) );
119+
sinon.assert.calledWithExactly( balloonAddSpy, sinon.match( data => data.stack == 'mention' ) );
112120
expect( panelView.isVisible ).to.be.true;
113121
expect( panelView.withArrow ).to.be.false;
114122
} );

0 commit comments

Comments
 (0)