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(
|
const editorKeybindingFn = React.useCallback(
|
||||||
|
// tslint:disable-next-line cyclomatic-complexity
|
||||||
(e: React.KeyboardEvent): CompositionInputEditorCommand | null => {
|
(e: React.KeyboardEvent): CompositionInputEditorCommand | null => {
|
||||||
if (e.key === 'Enter' && emojiResults.length > 0) {
|
if (e.key === 'Enter' && emojiResults.length > 0) {
|
||||||
e.preventDefault();
|
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);
|
return getDefaultKeyBinding(e);
|
||||||
},
|
},
|
||||||
[emojiResults, large]
|
[emojiResults, large]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue