1
0
mirror of https://github.com/hyperspacedev/hyperspace synced 2025-01-31 09:37:05 +01:00

Add Cmd+Enter functionality to compose window

This commit is contained in:
Marquis Kurt 2019-04-08 16:10:21 -04:00
parent b580d7059b
commit b68fb9e860

View File

@ -299,6 +299,12 @@ class Composer extends Component<any, IComposerState> {
});
}
postViaKeyboard(event: any) {
if ((event.metaKey || event.ctrlKey) && event.keyCode === 13) {
this.post();
}
}
post() {
let pollOptions: string[] = [];
if (this.state.poll) {
@ -378,6 +384,7 @@ class Composer extends Component<any, IComposerState> {
placeholder="What's on your mind?"
margin="normal"
onChange={(event) => this.updateTextFromField(event.target.value)}
onKeyDown={(event) => this.postViaKeyboard(event)}
inputProps = {
{
maxLength: 500