From 432ca90cb4fe522f8b04ada0d44d510624f50fcd Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sun, 14 Feb 2021 11:37:36 +0100 Subject: [PATCH] Changes to selection target now re-render the editor widgets (#34) --- src/editor/Editor.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index 64a7a80..da365a8 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -38,6 +38,11 @@ const Editor = props => { } }, [ bounds(props.selectedElement) ]); + useEffect(() => { + if (currentAnnotation) + setCurrentAnnotation(currentAnnotation.clone({ target: props.modifiedTarget })); + }, [ props.modifiedTarget ]) + const initResizeObserver = () => { if (window?.ResizeObserver) { const resizeObserver = new ResizeObserver(() => {