ensure both selected element and selected instance are the same id when selecting

This commit is contained in:
Oleg Isonen committed 2022-04-12 11:00:27 +01:00
1 parent 51574ce925
commit 4e02190f59
1 file changed
+3 -1
+3 -1
View File
@@ -28,7 +28,9 @@ export const useActiveElementTracking = () => {
if (element === null || rootInstance === undefined) return;
const id = element?.id;
if (!id) return;
if (selectedElement?.id === id) return;
if (selectedElement?.id === id && selectedInstance?.id === id) {
return;
}
const instance = findInstanceById(rootInstance, element.id);
if (instance === undefined) return;
setSelectedInstance(instance);