diff --git a/client/modules/IDE/components/NewFileForm.jsx b/client/modules/IDE/components/NewFileForm.jsx index 8e3b5977..d0a6b8ab 100644 --- a/client/modules/IDE/components/NewFileForm.jsx +++ b/client/modules/IDE/components/NewFileForm.jsx @@ -8,6 +8,10 @@ class NewFileForm extends React.Component { this.createFile = this.props.createFile.bind(this); } + componentDidMount() { + this.fileName.focus(); + } + render() { const { fields: { name }, handleSubmit } = this.props; return ( @@ -25,6 +29,7 @@ class NewFileForm extends React.Component { type="text" placeholder="Name" {...domOnlyProps(name)} + ref={(element) => { this.fileName = element; }} /> {name.touched && name.error && {name.error}}