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:
parent
b580d7059b
commit
b68fb9e860
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user