diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index 7962d0b..595c8d9 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -126,12 +126,16 @@ export default class Editor extends Component { !this.props.annotation?.isEqual(this.state.currentAnnotation); /** Shorthand **/ - updateCurrentAnnotation = (diff, saveImmediately) => this.setState({ - currentAnnotation: this.state.currentAnnotation.clone(diff) - }, () => { - if (saveImmediately) - this.onOk(); - }) + updateCurrentAnnotation = (diff, saveImmediately) => { + this.setState({ + currentAnnotation: this.state.currentAnnotation.clone(diff) + }, () => { + if (saveImmediately) + this.onOk(); + else + this.props.onChanged && this.props.onChanged(); + }) + } onAppendBody = (body, saveImmediately) => this.updateCurrentAnnotation({ body: [