support alt+enter on mac, like slate composer

This commit is contained in:
Bruno Windels 2019-08-20 14:14:07 +02:00
parent 9003a8836a
commit ea1faacd8b

View file

@ -186,7 +186,7 @@ export default class BasicMessageEditor extends React.Component {
} }
handled = true; handled = true;
// insert newline on Shift+Enter // insert newline on Shift+Enter
} else if (event.shiftKey && event.key === "Enter") { } else if (event.key === "Enter" && (event.shiftKey || (IS_MAC && event.altKey))) {
this._insertText("\n"); this._insertText("\n");
handled = true; handled = true;
// autocomplete or enter to send below shouldn't have any modifier keys pressed. // autocomplete or enter to send below shouldn't have any modifier keys pressed.