mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 13:05:08 +09:00
ensure both selected element and selected instance are the same id when selecting
This commit is contained in:
1 parent
51574ce925
commit
4e02190f59
1 file changed
+3
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user