content = content ? `${content}\n${imageMarkdown}` : imageMarkdown;
i.state.content = content;
i.state.imageLoading = false;
+ i.contentChange();
i.setState(i.state);
let textarea: any = document.getElementById(i.id);
autosize.update(textarea);
});
}
+ contentChange() {
+ if (this.props.onContentChange) {
+ this.props.onContentChange(this.state.content);
+ }
+ }
+
handleContentChange(i: MarkdownTextArea, event: any) {
i.state.content = event.target.value;
+ i.contentChange();
i.setState(i.state);
- if (i.props.onContentChange) {
- i.props.onContentChange(i.state.content);
- }
}
handlePreviewToggle(i: MarkdownTextArea, event: any) {
textarea.focus();
setTimeout(() => (textarea.selectionEnd -= 1), 10);
}
+ i.contentChange();
i.setState(i.state);
}
} else {
this.state.content += `${beforeChars}${emptyChars}${afterChars}`;
}
+ this.contentChange();
this.setState(this.state);
setTimeout(() => {
autosize.update(textarea);
setTimeout(() => {
autosize.update(textarea);
}, 10);
+ this.contentChange();
this.setState(this.state);
}
this.state.content += "\n";
}
this.state.content += quotedText;
+ this.contentChange();
this.setState(this.state);
// Not sure why this needs a delay
setTimeout(() => autosize.update(textarea), 10);