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

Make alt-enter insert new line on macOS
This commit is contained in:
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

View File

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