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
parent
f6154bc7cd
commit
15e68c3ba1
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue