From dea78173f6bc823b19a71752a7634927a68109b8 Mon Sep 17 00:00:00 2001 From: Kiran Ashok Date: Fri, 29 Sep 2023 10:58:15 +0530 Subject: [PATCH] Hotfix :: Components not showing up in dropdown for csa using page event handler (#7539) * fix :: componenets not showing up on page events for csa * remove comment --- frontend/src/Editor/Inspector/EventManager.jsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/src/Editor/Inspector/EventManager.jsx b/frontend/src/Editor/Inspector/EventManager.jsx index 2142538b86..390a7b6515 100644 --- a/frontend/src/Editor/Inspector/EventManager.jsx +++ b/frontend/src/Editor/Inspector/EventManager.jsx @@ -121,19 +121,18 @@ export const EventManager = ({ }); return componentOptions; } - // currently blocking items inside subcontainer because they can't be controlled through event manager - // use components instead of currentState?.components to get all the components in canvas + function getComponentOptionsOfComponentsWithActions(componentType = '') { let componentOptions = []; - Object.values(currentState?.components || {}).forEach((value) => { + Object.keys(components || {}).forEach((key) => { const targetComponentMeta = componentTypes.find( - (componentType) => components[value.id]?.component?.component === componentType?.component + (componentType) => components[key].component.component === componentType.component ); if ((targetComponentMeta?.actions?.length ?? 0) > 0) { - if (componentType === '' || components[value.id].component.component === componentType) { + if (componentType === '' || components[key].component.component === componentType) { componentOptions.push({ - name: components[value.id].component.name, - value: value.id, + name: components[key].component.name, + value: key, }); } }