diff --git a/src/AnnotationCreation.js b/src/AnnotationCreation.js index 3ce88cfe035ab4bb3b5c2f0a2ec3ff77bcaaa233..c0454b2ce9bcbbde4bbbe614a55a91500fc8043d 100644 --- a/src/AnnotationCreation.js +++ b/src/AnnotationCreation.js @@ -83,6 +83,7 @@ class AnnotationCreation extends Component { popoverAnchorEl: null, popoverLineWeightAnchorEl: null, svg: null, + textEditorStateBustingKey: 0, xywh: null, ...annoState, }; @@ -155,10 +156,10 @@ class AnnotationCreation extends Component { submitForm(e) { e.preventDefault(); const { - annotation, canvases, closeCompanionWindow, receiveAnnotation, config, + annotation, canvases, receiveAnnotation, config, } = this.props; const { - annoBody, tags, xywh, svg, + annoBody, tags, xywh, svg, textEditorStateBustingKey, } = this.state; canvases.forEach((canvas) => { const storageAdapter = config.annotation.adapter(canvas.id); @@ -181,10 +182,13 @@ class AnnotationCreation extends Component { }); } }); + this.setState({ - activeTool: null, + annoBody: '', + svg: null, + textEditorStateBustingKey: textEditorStateBustingKey + 1, + xywh: null, }); - closeCompanionWindow(); } /** */ @@ -222,6 +226,7 @@ class AnnotationCreation extends Component { const { activeTool, colorPopoverOpen, currentColorType, fillColor, popoverAnchorEl, strokeColor, popoverLineWeightAnchorEl, lineWeightPopoverOpen, strokeWidth, closedMode, annoBody, svg, + textEditorStateBustingKey, } = this.state; return ( <CompanionWindow @@ -355,6 +360,7 @@ class AnnotationCreation extends Component { </Grid> <Grid item xs={12}> <TextEditor + key={textEditorStateBustingKey} annoHtml={annoBody} updateAnnotationBody={this.updateBody} />