Bugfix
This commit is contained in:
parent
7873a7743c
commit
ae07174ea5
|
@ -36,12 +36,13 @@ const Editor = props => {
|
||||||
props.annotation;
|
props.annotation;
|
||||||
|
|
||||||
// The 'currentAnnotation' differs from props.annotation because
|
// The 'currentAnnotation' differs from props.annotation because
|
||||||
// the user has been editing. Moving the selection bounds will
|
// the user has been editing. Moving the selection bounds will
|
||||||
// trigger this effect, but we don't want to update the currentAnnotation
|
// trigger the re-render effect, but we don't want to update the currentAnnotation
|
||||||
// on move. Therefore, don't update if a) props.annotation equals
|
// on move. Therefore, don't update if a) props.annotation equals
|
||||||
// the currentAnnotation, or props.annotation and currentAnnotations are
|
// the currentAnnotation, or props.annotation and currentAnnotations are
|
||||||
// a selection, just created by the user.
|
// a selection, just created by the user.
|
||||||
const preventUpdate = currentAnnotation?.isEqual(annotation);
|
const preventUpdate = setCurrentAnnotation.isSelection ?
|
||||||
|
annotation.isSelection : currentAnnotation.annotationId === annotation.annotationId;
|
||||||
|
|
||||||
if (!preventUpdate)
|
if (!preventUpdate)
|
||||||
setCurrentAnnotation(annotation);
|
setCurrentAnnotation(annotation);
|
||||||
|
|
Loading…
Reference in New Issue