Make alt-enter insert new line on macOS

Alt-enter is a common macOS shortcut for inserting a new line in an
input that has a separate action tied to the enter key.

Signed-off-by: Ross Brandes <ross.brandes@gmail.com>
pull/21833/head
Ross Brandes 2019-04-15 21:15:38 -04:00
parent f6154bc7cd
commit 15e68c3ba1
No known key found for this signature in database
GPG Key ID: 05DC6CD248493D5E
1 changed files with 2 additions and 1 deletions

View File

@ -1041,7 +1041,8 @@ export default class MessageComposerInput extends React.Component {
};
handleReturn = (ev, change) => {
if (ev.shiftKey) {
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
if (ev.shiftKey || (isMac && ev.altKey)) {
return change.insertText('\n');
}