diff --git a/ui/src/components/markdown-textarea.tsx b/ui/src/components/markdown-textarea.tsx index 002d7c86b..0a7f904aa 100644 --- a/ui/src/components/markdown-textarea.tsx +++ b/ui/src/components/markdown-textarea.tsx @@ -25,6 +25,7 @@ interface MarkdownTextAreaProps { onSubmit?(msg: { val: string; formId: string }): any; onContentChange?(val: string): any; onReplyCancel?(): any; + hideNavigationWarnings?: boolean; } interface MarkdownTextAreaState { @@ -78,7 +79,7 @@ export class MarkdownTextArea extends Component< } componentDidUpdate() { - if (this.state.content) { + if (!this.props.hideNavigationWarnings && this.state.content) { window.onbeforeunload = () => true; } else { window.onbeforeunload = undefined; @@ -110,7 +111,10 @@ export class MarkdownTextArea extends Component< render() { return (
- +