diff --git a/src/TextAnnotator.jsx b/src/TextAnnotator.jsx index dad481e..6672bbf 100644 --- a/src/TextAnnotator.jsx +++ b/src/TextAnnotator.jsx @@ -61,9 +61,12 @@ export default class TextAnnotator extends Component { const { selection, clientRect } = evt; if (selection) { this.setState({ - selectionBounds: clientRect, - selectedAnnotation: selection - }); + selectedAnnotation: null, + selectionBounds: null + }, () => this.setState({ + selectedAnnotation: selection, + selectionBounds: clientRect + })) } else { this.clearState(); }