Browse Source

ensure reset button only shows if there is initialContent

fix/reset-textarea
ap1 10 months ago
parent
commit
a30a75208f
  1. 11
      src/components/markdown-textarea.tsx

11
src/components/markdown-textarea.tsx

@ -225,11 +225,12 @@ export class MarkdownTextArea extends Component<
{i18n.t('cancel')}
</Button>
)}
{this.state.content != this.props.initialContent && (
<Button variant="borderless" onClick={this.handleReset}>
{i18n.t('reset')}
</Button>
)}
{this.props.initialContent &&
this.state.content !== this.props.initialContent && (
<Button variant="borderless" onClick={this.handleReset}>
{i18n.t('reset')}
</Button>
)}
{this.state.content && (
<Button
variant="borderless"

Loading…
Cancel
Save