From 3f4e6a85ec4936efd4a4c4a644a9ffeaf0b94f36 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Fri, 29 May 2020 10:48:29 +0200 Subject: [PATCH] Added onAnnotationSelected call --- src/TextAnnotator.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/TextAnnotator.jsx b/src/TextAnnotator.jsx index 2a26a33..9d85358 100644 --- a/src/TextAnnotator.jsx +++ b/src/TextAnnotator.jsx @@ -70,7 +70,10 @@ export default class TextAnnotator extends Component { }, () => this.setState({ selectedAnnotation: selection, selectedDOMElement: element - })) + })); + + if (!selection.isSelection) + this.props.onAnnotationSelected(selection.clone()); } else { this.clearState(); }