Behavior tweak
This commit is contained in:
parent
83d7ac538b
commit
8cf539c4d4
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue