Behavior tweak

This commit is contained in:
Rainer Simon 2020-04-12 09:54:09 +02:00
parent 83d7ac538b
commit 8cf539c4d4
1 changed files with 3 additions and 2 deletions

View File

@ -18,11 +18,12 @@ const Editor = props => {
// Re-render: set derived annotation state & position the editor
useEffect(() => {
setCurrentAnnotation(props.annotation);
if (!currentAnnotation?.isEqual(props.annotation))
setCurrentAnnotation(props.annotation);
if (element.current)
setPosition(props.wrapperEl, element.current, props.bounds);
}, [ props.annotation, props.bounds ]);
}, [ props.bounds ]);
const onAppendBody = body => setCurrentAnnotation(
currentAnnotation.clone({