Skip to content

Commit

Permalink
Change buttonview to not prevent default action on mousedown.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmotyczynska committed Jul 11, 2022
1 parent c3fbf72 commit a52516a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions packages/ckeditor5-ui/src/button/buttonview.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ export default class ButtonView extends View {
children: this.children,

on: {
mousedown: bind.to( evt => {
evt.preventDefault();
} ),

click: bind.to( evt => {
// We can't make the button disabled using the disabled attribute, because it won't be focusable.
// Though, shouldn't this condition be moved to the button controller?
Expand Down
4 changes: 2 additions & 2 deletions packages/ckeditor5-ui/tests/button/buttonview.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ describe( 'ButtonView', () => {
} );

describe( 'mousedown event', () => {
it( 'should be prevented', () => {
it( 'should not be prevented', () => {
const ret = view.element.dispatchEvent( new Event( 'mousedown', { cancelable: true } ) );

expect( ret ).to.false;
expect( ret ).to.true;
} );
} );

Expand Down

0 comments on commit a52516a

Please sign in to comment.