diff --git a/frontend/src/components/menu-component/menu-dialog/create-fileforder-dialog.js b/frontend/src/components/menu-component/menu-dialog/create-fileforder-dialog.js index 1a754cb5c4..b4911162e3 100644 --- a/frontend/src/components/menu-component/menu-dialog/create-fileforder-dialog.js +++ b/frontend/src/components/menu-component/menu-dialog/create-fileforder-dialog.js @@ -27,6 +27,12 @@ class CreateFileForder extends React.Component { } } + handleKeyPress = (e) => { + if (e.key === 'Enter') { + this.handleSubmit(); + } + } + toggle = () => { if (this.props.isFile) { this.props.addFileCancel(); @@ -83,7 +89,7 @@ class CreateFileForder extends React.Component { - {this.newInput = input}} id="fileName" placeholder={gettext("newName")} value={this.state.childName} onChange={this.handleChange}/> + {this.newInput = input}} id="fileName" placeholder={gettext("newName")} value={this.state.childName} onChange={this.handleChange}/> diff --git a/frontend/src/components/menu-component/menu-dialog/rename-dialog.js b/frontend/src/components/menu-component/menu-dialog/rename-dialog.js index 06b01b258d..b8717c7a3e 100644 --- a/frontend/src/components/menu-component/menu-dialog/rename-dialog.js +++ b/frontend/src/components/menu-component/menu-dialog/rename-dialog.js @@ -21,6 +21,12 @@ class Rename extends React.Component { this.props.onRename(this.state.newName); } + handleKeyPress = (e) => { + if (e.key === 'Enter') { + this.handleSubmit() + } + } + toggle = () => { this.props.toggleCancel(); } @@ -59,7 +65,7 @@ class Rename extends React.Component { {type === 'file' ? gettext("Rename File") : gettext("Rename Folder") }

{type === 'file' ? gettext("Enter the new file name:"): gettext("Enter the new folder name:")}

- {this.newInput = input}} placeholder="newName" value={this.state.newName} onChange={this.handleChange} /> + {this.newInput = input}} placeholder="newName" value={this.state.newName} onChange={this.handleChange} />