Merge pull request #1274 from matrix-org/luke/fix-rte-keyboard-intercepts
Allow default for ctrl+shift+b, ctrl+shift+u in RTE
This commit is contained in:
commit
8af6d6fc9f
1 changed files with 6 additions and 3 deletions
|
@ -104,9 +104,12 @@ export default class MessageComposerInput extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow opening of dev tools. getDefaultKeyBinding would be 'italic' for KEY_I
|
// Allow opening of dev tools. getDefaultKeyBinding would be 'italic' for KEY_I
|
||||||
if (e.keyCode === KeyCode.KEY_I && e.shiftKey && e.ctrlKey) {
|
// Likewise protect bold and underline (in case some browsers use these as
|
||||||
// When null is returned, draft-js will NOT preventDefault, allowing dev tools
|
// shortcuts for things).
|
||||||
// to be toggled when the editor is focussed
|
if ([KeyCode.KEY_B, KeyCode.KEY_I, KeyCode.KEY_U].includes(e.keyCode) &&
|
||||||
|
e.shiftKey && e.ctrlKey
|
||||||
|
) {
|
||||||
|
// When null is returned, draft-js will NOT preventDefault
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue