diff --git a/example/src/example.js b/example/src/example.js
index a1d55dd..854f481 100644
--- a/example/src/example.js
+++ b/example/src/example.js
@@ -16,11 +16,12 @@ var App = React.createClass({
},
render () {
var preview = marked(this.state.code);
+ var options = { buttonType: 'button' };
return (
The editor is below, with default options. This example also uses marked to generate the preview on the right as you type.
-
+
diff --git a/src/MDEditor.js b/src/MDEditor.js
index e769288..d8ea5a1 100644
--- a/src/MDEditor.js
+++ b/src/MDEditor.js
@@ -99,9 +99,13 @@ var MarkdownEditor = React.createClass({
}, ('MDEditor_toolbarButton--' + formatKey));
var labelClass = isTextIcon ? 'MDEditor_toolbarButton_label-icon' : 'MDEditor_toolbarButton_label';
-
+
+ //Button type will default to submit if not specified,
+ // which can cause issues when this editor is embedded in a form.
+ var buttonType = this.getOptions().buttonType || 'button';
+
return (
-