Skip to content

Commit

Permalink
Fix shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Oct 22, 2018
1 parent a688ac8 commit 6d7e50a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/editor/src/components/rich-text/format-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Shortcut extends Component {

onUse() {
this.props.onUse();
return false;
}

render() {
Expand Down
10 changes: 10 additions & 0 deletions packages/editor/src/components/rich-text/tinymce.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ export default class TinyMCE extends Component {
setup: ( editor ) => {
this.editor = editor;
this.props.onSetup( editor );

editor.on( 'init', () => {
// See https://github.com/tinymce/tinymce/blob/master/src/core/main/ts/keyboard/FormatShortcuts.ts
[ 'b', 'i', 'u' ].forEach( ( character ) => {
editor.shortcuts.remove( `meta+${ character }` );
} );
[ 1, 2, 3, 4, 5, 6, 7, 8, 9 ].forEach( ( number ) => {
editor.shortcuts.remove( `access+${ number }` );
} );
} );
},
} );
}
Expand Down

0 comments on commit 6d7e50a

Please sign in to comment.