Merge pull request #2923 from rosston/alt-enter-mac

Make alt-enter insert new line on macOS
pull/21833/head
J. Ryan Stinnett 2019-04-17 16:19:57 +01:00 committed by GitHub
commit 232fd8656b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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');
}