onSubmit?(msg: { val: string; formId: string }): any;
onContentChange?(val: string): any;
onReplyCancel?(): any;
+ hideNavigationWarnings?: boolean;
}
interface MarkdownTextAreaState {
}
componentDidUpdate() {
- if (this.state.content) {
+ if (!this.props.hideNavigationWarnings && this.state.content) {
window.onbeforeunload = () => true;
} else {
window.onbeforeunload = undefined;
render() {
return (
<form id={this.formId} onSubmit={linkEvent(this, this.handleSubmit)}>
- <Prompt when={this.state.content} message={i18n.t('block_leaving')} />
+ <Prompt
+ when={!this.props.hideNavigationWarnings && this.state.content}
+ message={i18n.t('block_leaving')}
+ />
<div class="form-group row">
<div className={`col-sm-12`}>
<textarea