CompositionInput: Prevent ctrl+shift+m from adding a newline
This commit is contained in:
parent
5750412fda
commit
01bf53776b
1 changed files with 8 additions and 0 deletions
|
@ -651,6 +651,7 @@ export const CompositionInput = ({
|
|||
);
|
||||
|
||||
const editorKeybindingFn = React.useCallback(
|
||||
// tslint:disable-next-line cyclomatic-complexity
|
||||
(e: React.KeyboardEvent): CompositionInputEditorCommand | null => {
|
||||
if (e.key === 'Enter' && emojiResults.length > 0) {
|
||||
e.preventDefault();
|
||||
|
@ -692,6 +693,13 @@ export const CompositionInput = ({
|
|||
}
|
||||
}
|
||||
|
||||
// Get rid of Ctrl-Shift-M, which by default adds a newline
|
||||
if ((e.key === 'm' || e.key === 'M') && e.shiftKey && e.ctrlKey) {
|
||||
e.preventDefault();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return getDefaultKeyBinding(e);
|
||||
},
|
||||
[emojiResults, large]
|
||||
|
|
Loading…
Reference in a new issue