@@ -87,6 +87,8 @@ export default class CommentForm extends React.Component {
html: '',
key: 1,
});
+ // reset value
+ this.refs.editor.setValue('');
}
@@ -21,6 +21,12 @@ export default class AbstractEditor extends React.Component {
forceToFocus() {
+ /**
+ * set new value
+ */
+ setValue(newValue) {
+ }
+
/**
* set caret position of codemirror
* @param {string} number
@@ -129,6 +129,14 @@ export default class CodeMirrorEditor extends AbstractEditor {
}, 100);
+ * @inheritDoc
+ this.setState({ value: newValue });
+ this.getCodeMirror().getDoc().setValue(newValue);
* @inheritDoc
*/
@@ -50,6 +50,13 @@ export default class Editor extends AbstractEditor {
this.getEditorSubstance().forceToFocus();
+ this.getEditorSubstance().setValue(newValue);
@@ -57,6 +57,14 @@ export default class TextAreaEditor extends AbstractEditor {
}, 150);
+ this.textarea.value = newValue;