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

Commit e5315df

Browse files
authored
Merge pull request #295 from ckeditor/t/294
Fix: The content of the `BalloonPanelView` should be selectable. Closes #294. Closes ckeditor/ckeditor5#498.
2 parents a21b097 + f020d01 commit e5315df

File tree

3 files changed

+1
-33
lines changed

3 files changed

+1
-33
lines changed

src/panel/balloon/balloonpanelview.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { getOptimalPosition } from '@ckeditor/ckeditor5-utils/src/dom/position';
1313
import isRange from '@ckeditor/ckeditor5-utils/src/dom/isrange';
1414
import isElement from '@ckeditor/ckeditor5-utils/src/lib/lodash/isElement';
1515
import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit';
16-
import preventDefault from '../../bindings/preventdefault.js';
1716
import global from '@ckeditor/ckeditor5-utils/src/dom/global';
1817

1918
const toPx = toUnit( 'px' );
@@ -130,15 +129,7 @@ export default class BalloonPanelView extends View {
130129
}
131130
},
132131

133-
children: this.content,
134-
135-
on: {
136-
// https://github.com/ckeditor/ckeditor5-ui/issues/206
137-
mousedown: preventDefault( this ),
138-
139-
// https://github.com/ckeditor/ckeditor5-ui/issues/243
140-
selectstart: bind.to( evt => evt.preventDefault() )
141-
}
132+
children: this.content
142133
} );
143134
}
144135

tests/panel/balloon/balloonpanelview.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -121,27 +121,6 @@ describe( 'BalloonPanelView', () => {
121121
expect( view.element.childNodes.length ).to.equal( 1 );
122122
} );
123123
} );
124-
125-
describe( 'event listeners', () => {
126-
it( 'prevent default on #mousedown', () => {
127-
const evt = new Event( 'mousedown', { bubbles: true } );
128-
const spy = sinon.spy( evt, 'preventDefault' );
129-
130-
view.element.dispatchEvent( evt );
131-
sinon.assert.calledOnce( spy );
132-
} );
133-
134-
// https://github.com/ckeditor/ckeditor5-ui/issues/243
135-
it( 'prevents default on #selectstart', () => {
136-
const event = new Event( 'selectstart', { bubbles: true } );
137-
const spy = sinon.spy( event, 'preventDefault' );
138-
const child = document.createElement( 'div' );
139-
140-
view.element.appendChild( child );
141-
child.dispatchEvent( event );
142-
sinon.assert.calledOnce( spy );
143-
} );
144-
} );
145124
} );
146125

147126
describe( 'show()', () => {

theme/components/panel/balloonpanel.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// For licensing, see LICENSE.md or http://ckeditor.com/license
33

44
.ck-balloon-panel {
5-
@include ck-unselectable();
6-
75
display: none;
86
position: absolute;
97

0 commit comments

Comments
 (0)