Merge pull request #1150 from matrix-org/luke/fix-rte-dev-tools-toggle

Allow toggling of dev tools when RTE focussed
This commit is contained in:
Luke Barnard 2017-06-27 15:38:19 +01:00 committed by GitHub
commit 4645ba1bba
2 changed files with 30 additions and 0 deletions

View file

@ -87,6 +87,13 @@ export default class MessageComposerInput extends React.Component {
return 'toggle-mode';
}
// Allow opening of dev tools. getDefaultKeyBinding would be 'italic' for KEY_I
if (e.keyCode === KeyCode.KEY_I && e.shiftKey && e.ctrlKey) {
// When null is returned, draft-js will NOT preventDefault, allowing dev tools
// to be toggled when the editor is focussed
return null;
}
return getDefaultKeyBinding(e);
}