diff --git a/src/renderer/components/+workspaces/workspaces.tsx b/src/renderer/components/+workspaces/workspaces.tsx index fa7363dd9a..8efa4a1306 100644 --- a/src/renderer/components/+workspaces/workspaces.tsx +++ b/src/renderer/components/+workspaces/workspaces.tsx @@ -93,6 +93,12 @@ export class Workspaces extends React.Component { }) } + onInputKeypress = (evt: React.KeyboardEvent, workspaceId: WorkspaceId) => { + if (evt.key == 'Enter') { + this.saveWorkspace(workspaceId); + } + } + render() { return ( @@ -142,6 +148,7 @@ export class Workspaces extends React.Component { placeholder={_i18n._(t`Name`)} value={editingWorkspace.name} onChange={v => editingWorkspace.name = v} + onKeyPress={(e) => this.onInputKeypress(e, workspaceId)} autoFocus /> editingWorkspace.description = v} - /> - Cancel} - onClick={() => this.clearEditing(workspaceId)} + onKeyPress={(e) => this.onInputKeypress(e, workspaceId)} /> Save} onClick={() => this.saveWorkspace(workspaceId)} /> + Cancel} + onClick={() => this.clearEditing(workspaceId)} + /> )}