Skip to content

Instantly share code, notes, and snippets.

@karthiks
Last active April 2, 2018 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karthiks/200b9468325bb7a3cac1cc976e3f04b5 to your computer and use it in GitHub Desktop.
Save karthiks/200b9468325bb7a3cac1cc976e3f04b5 to your computer and use it in GitHub Desktop.
Submit form at the click of an Enter/Return button
class EditTaskModal extends Component {
.
.
.
render() {
return (
<form onSubmit={(e)=>this.modifyTask(e)}>
<input className="ToDoInput" value={this.state.task} onChange={this.handleEditingTask} />
<button type="submit" className="ToDoSubmit"> Edit </button>
</form>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment