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 #295 from ckeditor/t/294
Browse files Browse the repository at this point in the history
Fix: The content of the `BalloonPanelView` should be selectable. Closes #294. Closes ckeditor/ckeditor5#498.
  • Loading branch information
oleq authored Sep 5, 2017
2 parents a21b097 + f020d01 commit e5315df
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 33 deletions.
11 changes: 1 addition & 10 deletions src/panel/balloon/balloonpanelview.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { getOptimalPosition } from '@ckeditor/ckeditor5-utils/src/dom/position';
import isRange from '@ckeditor/ckeditor5-utils/src/dom/isrange';
import isElement from '@ckeditor/ckeditor5-utils/src/lib/lodash/isElement';
import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit';
import preventDefault from '../../bindings/preventdefault.js';
import global from '@ckeditor/ckeditor5-utils/src/dom/global';

const toPx = toUnit( 'px' );
Expand Down Expand Up @@ -130,15 +129,7 @@ export default class BalloonPanelView extends View {
}
},

children: this.content,

on: {
// https://github.com/ckeditor/ckeditor5-ui/issues/206
mousedown: preventDefault( this ),

// https://github.com/ckeditor/ckeditor5-ui/issues/243
selectstart: bind.to( evt => evt.preventDefault() )
}
children: this.content
} );
}

Expand Down
21 changes: 0 additions & 21 deletions tests/panel/balloon/balloonpanelview.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,27 +121,6 @@ describe( 'BalloonPanelView', () => {
expect( view.element.childNodes.length ).to.equal( 1 );
} );
} );

describe( 'event listeners', () => {
it( 'prevent default on #mousedown', () => {
const evt = new Event( 'mousedown', { bubbles: true } );
const spy = sinon.spy( evt, 'preventDefault' );

view.element.dispatchEvent( evt );
sinon.assert.calledOnce( spy );
} );

// https://github.com/ckeditor/ckeditor5-ui/issues/243
it( 'prevents default on #selectstart', () => {
const event = new Event( 'selectstart', { bubbles: true } );
const spy = sinon.spy( event, 'preventDefault' );
const child = document.createElement( 'div' );

view.element.appendChild( child );
child.dispatchEvent( event );
sinon.assert.calledOnce( spy );
} );
} );
} );

describe( 'show()', () => {
Expand Down
2 changes: 0 additions & 2 deletions theme/components/panel/balloonpanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// For licensing, see LICENSE.md or http://ckeditor.com/license

.ck-balloon-panel {
@include ck-unselectable();

display: none;
position: absolute;

Expand Down

0 comments on commit e5315df

Please sign in to comment.