client/src/components/SessionForm.js
changeset 169 f98efa1bddd1
parent 168 ea92f4fe783d
child 170 7da1d5137b0b
--- a/client/src/components/SessionForm.js	Mon Oct 08 18:35:47 2018 +0200
+++ b/client/src/components/SessionForm.js	Thu Oct 11 11:05:04 2018 +0200
@@ -24,7 +24,7 @@
   }
 
   onChangeThrottle = _.debounce((changes) => {
-    this.props.sessionsActions.updateSession(this.props.currentSession, changes);
+    this.props.sessionsActions.updateSession(this.props.currentSession._id, changes);
   }, 750)
 
   onGroupChange = (e) => {
@@ -92,16 +92,19 @@
 
   saveEdit = (e) => {
 
+    // e.preventDefault();
 
-    if (e.key === 'Enter') {
-      this.setState({enterKeyValue: true})
-    }
+    // if (e.key === 'Enter') {
+    //   this.setState({enterKeyValue: true})
+    // }
 
-    if (e.key !== 'Enter') {
-      this.setState({enterKeyValue: false})
-    }
+    // if (e.key !== 'Enter') {
+    //   this.setState({enterKeyValue: false})
+    // }
 
     if (e.key === 'Enter' && this.state.enterKeyValue === true) {
+
+      e.preventDefault();
       this.setState({
         enterKeyValue: false,
         titleEditMode: false,