client/src/components/SlateEditor.js
changeset 64 aecde527900a
parent 62 b2514a9bcd49
child 72 7634b424f426
--- a/client/src/components/SlateEditor.js	Tue Jun 20 16:08:12 2017 +0200
+++ b/client/src/components/SlateEditor.js	Tue Jun 20 17:54:02 2017 +0200
@@ -196,6 +196,15 @@
    */
 
   onKeyDown = (e, data, state) => {
+
+    if (data.key === 'enter') {
+      if (typeof this.props.onEnterKeyDown === 'function') {
+        e.preventDefault();
+        this.props.onEnterKeyDown();
+        return state;
+      }
+    }
+
     if (!data.isMod) return
     let mark